Forum Replies Created

Viewing 7 replies - 1 through 7 (of 7 total)
  • Thread Starter seanyscon

    (@seanyscon)

    Hi

    How can I do that programettically? Thank you

    Thread Starter seanyscon

    (@seanyscon)

    Hi

    It is a custom button I added to some products, via the functions.php script. The code is:

    remove_action( 'woocommerce_before_shop_loop_item_title', 'woocommerce_show_product_loop_sale_flash', 10 );
    remove_action( 'woocommerce_before_single_product_summary', 'woocommerce_show_product_sale_flash', 10 );
    
    add_action( 'woocommerce_before_shop_loop_item_title', 'woocommerce_custom_sale_text', 10 );
    add_action( 'woocommerce_before_single_product_summary', 'woocommerce_custom_sale_text', 10 );
    
    
    function woocommerce_custom_sale_text()
    {
       global $post,$product;
       if ( ! $product->is_in_stock() ) {
           echo '<div ' ;
           echo 'class="openPopUp wd-buy-now-btn button alt add_to_cart_button ajax_add_to_cart add_no_loop" ';
           echo 'style="background-color:rgba(255,255,255,0.75);color:rgb(255,153,0); position: absolute;top: 10%; left: 50%;transform: translate(-50%, -90%);-ms-transform: translate(-50%, -90%);';
           echo 'border: 4px solid;border-color:rgb(255,153,0);border-radius:10px;">';
           echo '<i class="fa fa-bell" aria-hidden="true"></i>&nbsp;&nbsp;&nbsp;&nbsp;Verfügbarkeitsalarm</div>';
           echo '<div id="popup" class="popup" style="display:none;position:absolute;top:50%;left:50%;';//transform:translate(-50%, -05%);';
           echo 'z-index:10000;background-color:#FDFDFD;width:1000px;padding:20px;border: 4px solid;border-color:rgb(255,153,0);border-radius:5px;" onclick="event.preventDefault();event.stopPropagation();">' ;
    
           echo '<p onclick="event.preventDefault();event.stopPropagation();">M?chten Sie benachrichtigt werden, wenn dieses Produkt wieder auf Lager ist?</p>';   // Text
    
            $params = apply_filters( 'woocommerce_bis_front_end_params', array(
                           'version'                 => WC_BIS()->get_plugin_version(),
                           'wc_ajax_url'             => WC_AJAX::get_endpoint( '%%endpoint%%' ),
                           'registration_form_nonce' => wp_create_nonce( 'wc-bis-registration-form' )
                   ) );
    
           echo '<input type="hidden" class="cwg-security" name="cwg-security" value="' . /*wp_create_nonce('codewoogeek-product_id-' . $product)*/ '5e167eac74' . '"/>';
           echo '<input type="hidden" class="cwg-productID" name="cwg-productID" value="'. $product->get_id() . '"/>';
           echo '<input type="hidden" class="cwg-ajaxURL" name="cwg-ajaxURL" value="' . '/?wc-ajax=%%endpoint%%&elementor_page_id=' . $product->get_id() . '"/>';
    
    
           if ( ! (is_user_logged_in()) )  echo '<input class="cwg-email" name="cwg-email" type="text" placeholder="Enter your e-mail" onclick="event.preventDefault();event.stopPropagation();">';
           echo '<button class="button" type="button" onclick="submitData_frompopUP();">';
           echo 'Ja        </button>';
           echo '</div>';
       }
    
    }

    Functions.php has enqueued my own script file, script.js. My goal is to define the submitData_frompopUP(); function in the file script.js, such that when the onclick action is triggered, the content of the cwg-email item will be submitted to the plugin, along with the product id, so that once the product is back in stock, an email will be sent to this email.

    Alternative : I want to bind the register email for when a product is back instock functionality to a custom button, as above.

    Thank you.

    Thread Starter seanyscon

    (@seanyscon)

    Right now, as i said, I reinstalled, purged and deactivated the plugin.
    However, before I did that the following happened:

    I have a page open which calls upon a template, and if i made any changes in the template + php therein, it will not be reflected in the browser, even if i clear browser cache, clear wp cache, and i will see in the open page’s source, that page was generated by litespeed at an older time.

    But if i opened a different page, also calling on same template + php as in the previous one, the changes would be reflected immediately.

    AFter I reinstalled, purged and deactivated litespeed, this problem went away.

    Thread Starter seanyscon

    (@seanyscon)

    I checked every .htaccess file on the server, after logging in with SSH, but there is nothing.

    Specifically i looked for LSCACHE and LSCS keywords. But I did not find those regions in any of the .htaccess files (the global one in servers root directory, and the one in the domain root and there was also another in the plugin directory)

    Thread Starter seanyscon

    (@seanyscon)

    I can use cURL do send requests and get answers.

    Thread Starter seanyscon

    (@seanyscon)

    I have done all of that already as well. That *uninstalled* the plugin, but did not clear the cache. That is the point of this post.

    Thread Starter seanyscon

    (@seanyscon)

    Hello

    I reinstalled litespeed, purged and now deactivated it. I wanted to know a way to do the same over SSH and without having to log in to wordpress control panel.

    Thank you.

Viewing 7 replies - 1 through 7 (of 7 total)