• Resolved calabronelampa

    (@calabronelampa)


    Hi,
    i want to show a pop-up after that the vendor add a product.
    I already customize the page edit-product.php.

    Is it possible to have some information about it ?

    The pop-up will contain a button to share the product added on different social.

    I tried to show it, but i doesn’t works.

    Thank you.

Viewing 7 replies - 1 through 7 (of 7 total)
  • @calabronelampa, do you want to display the pop-up when then the vendor will save the product. If yes, then you need to use this action ‘wcmp_process_product_object’ and add your custom code.

    Let us know if you have any further query.

    Thread Starter calabronelampa

    (@calabronelampa)

    Hi,
    im trying to show a simple alert but it doesn’t show after add or update.

    Here the code that i wrote on my function.php

    function test(){
    	
              ?>
        <script type="text/javascript">
            function codeAddress() {
                alert('ok');
            }
            window.onload = codeAddress;
        </script>
    
        <?php
    	
    }
    
    add_action( 'wcmp_process_product_object', 'test', 10, 0 );

    What’s wrong ?

    @calabronelampa, If you add a die; or exit; before the end of your php function, you can see the output of your alert. But we never suggest you to do your work in this way, best way to do is set a variable or message on this hook and using this variable/message show your custom modal or popup.

    Thread Starter calabronelampa

    (@calabronelampa)

    Hi,
    unfortunately i’m trying with your seggestion but still i see nothing after publish a product.

    Is it possible to have an good example to show something after publish product ?

    Thanks.

    @calabronelampa, can you share the updated code, so we can check.

    Thread Starter calabronelampa

    (@calabronelampa)

    Hi,
    i tried to show a simple div.

    here the code.

    function showPopUP(){
    echo '<div id="myPopup" class="modal">'
      <!-- Modal content -->
    echo '  <div class="modal-content">'
    echo '   <span class="close">&times;</span>'
    echo '   <p>Some text in the Modal..</p>'
    echo ' </div>'
    echo '</div>'
    }
    add_action( 'wcmp_process_product_object', 'showPopUP', 10, 0 );

    let me know thanks.

    Thread Starter calabronelampa

    (@calabronelampa)

    Hi,
    thanks anyway. I did by myself. ??

    Have a nice day !

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Show Pop-up After Product Added’ is closed to new replies.