Using CSS, how can I remove a Woocommerce grid from a specific page that has ::before & ::after inserted in it

Everything between the before and after needs to go

The specific page ID is 6329

I have tried different variations of the CSS below, but still can’t get it to work!

CSS used:

.page-id-6329 .products.columns-3 {
display: none !important;
}

and other variations on the same lines with no success. I think it has to do with the ::before and ::after, but have no idea how to write the CSS.

I am setting up a website that caters for retail and wholesale. The retail will show the normal category grid to the user, while the wholesale will have a special page where a list of products shown in a table.
The wholesale page, as it is now, shows the category grid AND the table underneath. I just need to get the grid to disappear for that particular page.

Any help will be appreciated.
Thanks

Big Woocommerce Shop

Hi

I have an Shop with an Mysql database of 100mb. if i dont cache it takes like 10 seconds to load the site.

now i want to build an f… | Read the rest of https://www.webhostingtalk.com/showthread.php?t=1843509&goto=newpost

woocommerce offtopic – Function to recalculate shipping costs on subscriptions after renewal with Automatewoo

I’ve got a funky plugin that was custom made that adds a new random product from a group that a customer subscribes to.

Problem is, that the shipping doesn’t change depending on which product is selected, it stays with whatever was chosen initially.

Rather than paying more money to redevelop something that might already exist, is there any code that will recalculate shipping costs based on the item in the subscription? I have automatewoo, so could use a custom function from that and run it after a subscription payment has completed, I just don’t know how to code it.

Any support appreciated!

Jono.

functions – Edit Woocommerce Subscription Start Date + Frequency at Checkout

I have a Woocommerce site running Woocommerce Subscriptions plugin.

The site only has one simple subscription, limited to one per user. I want to allow the user to set their own start time and subscription frequency, based on selections made in a dropdown box added during the checkout process.

I have added the checkout fields correctly, and they are simple select boxes:

    <select name="frequency" id="choose_frequency">
       <option value="week">Weekly</option>
       <option value="2week">Fortnightly</option>
       <option value="monthly">Monthly</option>
    </select>

    <select name="start-date" id="sub_start_date">
        <option value="22 Apr 2021">Thursday, 22 April 2021</option>
        <option value="29 Apr 2021">Thursday, 29 April 2021</option>
        <option value="6 May 2021">Thursday, 6 May 2021</option>
    </select>

I need to get the value, convert it to the correct meta, and then update the subscription before it has been created.

I’ve tried to update the meta using woocommerce_checkout_update_order_meta:

//Update the order meta with custom fields values
add_action('woocommerce_checkout_update_order_meta', 'customise_checkout_field_update_order_meta');
function customise_checkout_field_update_order_meta($order_id){
    $subscriptions_ids = wcs_get_subscriptions_for_order( $order_id );
    foreach( $subscriptions_ids as $subscription_id => $subscription_obj ){
        update_post_meta($subscription_id, '_schedule_start',date('Y-m-d h:i:s',$_POST('sub_start_date')));
    }
}

and also tried wcs_create_subscription:

// set start subscription date on checkout page
add_action('wcs_create_subscription', 'cc_wcs_create_subscription');
function cc_wcs_create_subscription($subscription){
    $order_id = $subscription->order->id;
    $subscription_id = $subscription->get_id();
    if($subscription_id  && $_POST('sub_start_date')){
                update_post_meta($subscription_id, '_schedule_start',date('Y-m-d h:i:s',$_POST('sub_start_date')));
    }
}

… I’ve even tried updating the frequency with AJAX:

jQuery(document).on('change','select#choose_frequency',function(){
    var cur_val = jQuery(this).val();
    jQuery.ajax({
            type:'post',
            url:woocommerce_params.ajax_url,
            data:{'action':'cc_update_product_subscription','productid':1086,'cur_val':cur_val},
            success:function(result){
                jQuery(document.body).trigger("update_checkout");
            }
    });
});
// update subscription frequency on checkout page
add_action('wp_ajax_cc_update_product_subscription','cc_update_product_subscription');
add_action('wp_ajax_nopriv_cc_update_product_subscription','cc_update_product_subscription');
function cc_update_product_subscription(){
    if($_POST('cur_val') == 'week'){
        update_post_meta($_POST('productid'),'_billing_interval','1');
        update_post_meta($_POST('productid'),'_billing_period','week');        
    }
    if($_POST('cur_val') == '2week'){
        update_post_meta($_POST('productid'),'_billing_interval','2');
        update_post_meta($_POST('productid'),'_billing_period','week');
    }
    if($_POST('cur_val') == 'monthly'){
        update_post_meta($_POST('productid'),'_billing_interval','1');
        update_post_meta($_POST('productid'),'_billing_period','month');
    }
    
    die();
}

Nothing seems to be working. The checkout is still processing through to completion, but the subscription details are not updated to reflect those selected by the user. What am I doing wrong?

php – Get attribute label on cart page Woocommerce

Issue/Desired Result

I want to get the attribute_label on the cart page of my Woocommerce store, for example, ‘Size’. My current code is giving me the slug, for example, ‘Attribute_size’.

How can I update my code to get the attribute label?

cart.php Code

// Meta data
    if (!empty($cart_item('variation'))) {
        echo '<div class="variation">';
            foreach ($cart_item('variation') as $key => $variation) {
                echo '<div><span>' . ucwords(str_replace(array('pa_', '-2'), '', $key)) . ':</span>
        <p>' . $variation . '</p></div>';
                                    }
                                echo '</div>';
                            }

WooCommerce doesn’t display product-categories – WordPress Development Stack Exchange

At the moment I’m working on two wordpress websites which are owned by a friend of mine. Both of those websites use woocommerce as a shop. Both websites display the same content and products. The only difference is that they are setup in different languages (german and english).
Both shops use main-categories and sub-categories like this:

  • Main category 1
    — Sub-category 1 in main 1
    — Sub-category 2 in main 1
  • Main category 2
    — Sub-category 1 in main 2
    — Sub-category 2 in main 2
  • Main category 3
    — Sub-category 1 in main 3
    — Sub-category 2 in main 3

The sub-categories contain the different products. The main categories are setup to only display the sub-categories while the sub-categories are setup to only show the products.

Yesterday I realized that on the german website that none of the main-categories and sub-categories are displayed anymore. The products are still there and can be viewed through the direct link but the shop navigation itself doesn’t show anything. After several hours of trying to find the reason for this I found out that this is happening because all the products are setup to only be a part of the sub-categories and not the main-categories. When I change the settings of the products that they also belong to the main-category then everything works like it used to.

The most surprising thing about all of this is that the english website works just fine and doesn’t have this issue at all. Both websites use the same template and the same plugins. The versions of wordpress, the template and all the plugins are also the same on both sites. There are however a few code-snippets that are used only on the german website. I deactivated all of them yesterday and the issue was still there which leads me to believe that those can’t be the reason for this issue.

I would love to post some code along with this question, but I have no idea which code to display here. Does anybody have an idea about how I could try to figure out this issue? I really don’t know what else to try. Any help would be appreciated. Thanks in advance.

Pricing conditions in WooCommerce – WordPress Development Stack Exchange

Pricing conditions in WooCommerce – WordPress Development Stack Exchange

woocommerce offtopic – Is it safe to delete from db orphaned posts i.e. whose post_parent no longer exists?

I inherited a couple of WP + WooCommerce shops with roughly 30,000 products for sale each, and a wp_postmeta which is over a million lines. The former webmasters ran away.

In an effort to clean up old stuff, I noticed a post_parent field in wp_posts, and queried the database for orphans:

SELECT ID FROM wp_posts WHERE NOT post_parent IN 
  (SELECT ID FROM wp_posts) AND post_parent>0 

and found thousands of records.
All of these records have a post_parent which no longer exists.

Just out of curiosity, I checked wp_postmeta:

SELECT * FROM wp_postmeta where post_id in
  (SELECT ID FROM wp_posts where not post_parent in 
     (select ID from wp_posts) and post_parent>0 ) 

and found 60,000 records.

Is it safe to delete them, along with any references from the tables wp_postmeta, wp_comments, wp_commentmeta, wp_term_relationships, wp_wc_product_meta_lookup ?

Else, can you suggest a strategy to clean up the database from spurious data?

php – How to display Woocommerce cross-sells in single product tabs

I’m trying to display cross sells using the following function:

woocommerce_cross_sell_display();

This function is part of Woocommerce default functions, and it suppose to work. Meanwhile I receive nothing (No error, no visual results).

Here is how I tried to display cross sells in Woocommerce tabs:

//Add custom tabs filter
add_filter('woocommerce_product_tabs', 'add_new_default_product_tab' );
function add_new_default_product_tab( $tabs ) {

    global $product;

    // set the new priority to the "reviews" tab
    $tabs('reviews')('priority') = 20;

    // gets the value to use as the title and slug of the new tab
    $custom_tab_title = "אביזרים";
    $custom_tab_title2 = "אביזרים משלימים";

    // if the custom field is set, it adds the new tab
    if ( ! empty($custom_tab_title) ) {
        $tabs('awp-' . sanitize_title('props')) = array(
            'title' => 'אביזרים',
            'callback' => 'awp_custom_woocommerce_tabs',
            'priority' => 5
        );
    }
    if ( ! empty($custom_tab_title) ) {
        $tabs('awp-' . sanitize_title('additional-props')) = array(
            'title' => 'אביזרים משלימים',
            'callback' => 'awp_custom_woocommerce_tabs2',
            'priority' => 10
        );
    }
    return $tabs;
}
 
    //Callback to display upsells (WORKS)
    
    function awp_custom_woocommerce_tabs($key, $tab) {
         woocommerce_upsell_display( 3,3 );
    }
    
    
    //Callback to display cross sells (Doesn't work)
    
    function awp_custom_woocommerce_tabs2($key, $tab) {
        woocommerce_cross_sell_display();
    }

Also tried displaying cross sells just to test if it works even when it’s not inside the tabs. It doesn’t, I’m lost here.

remove_action( 'woocommerce_after_add_to_cart_button', 'woocommerce_cross_sell_display' );
add_action( 'woocommerce_after_add_to_cart_button', 'woocommerce_cross_sell_display', 15);

How can I display cross sells on tabs in single product page? And what is affecting cross sells visibility?

DreamProxies - Cheapest USA Elite Private Proxies 100 Private Proxies 200 Private Proxies 400 Private Proxies 1000 Private Proxies 2000 Private Proxies ExtraProxies.com - Buy Cheap Private Proxies Buy 50 Private Proxies Buy 100 Private Proxies Buy 200 Private Proxies Buy 500 Private Proxies Buy 1000 Private Proxies Buy 2000 Private Proxies ProxiesLive Proxies-free.com New Proxy Lists Every Day Proxies123