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

WooCommerce Default Sorting Filter Drop Down colours CSS

I have been trying to change the colours for the hovered default sorting filter on the woocommerce shop page but I cannot seem to find the selector in Google Chrome developer tools, I can’t seem to find the CSS that is controlling the colour of this hover element.

The solution below works for the country selector dropdown only it seems, but it does not change the default sorting hover colour. Does anyone know the correct selector for the default sorting filter selector, please?

/changing select hover country checkout page colour/
.select2-container–default .select2-results__option[aria-selected=true]{
background-color: #FF0000;
}

.select2-container–default .select2-results__option[data-selected=true]{
background-color: #0000FF;
}
/end/

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.

plugins – Add Woocommerce Fast and standard delivery optin

plugins – Add Woocommerce Fast and standard delivery optin – WordPress Development Stack Exchange

Querying WooCommerce Membership restricted content

Is it possible to build a query for the following:

  1. For members, within the search results, it is required that only restricted content (as specified by the WooCommerce membership addon) is shown to that member (i.e. the non-member content is hidden).
  2. For non-members, the opposite should be true, that is restricted membership content should be hidden.

We have the Relevanssi plugin installed, I’m not sure if that will change things

woocommerce offtopic – WordPress Custom Cart

hello guys i have a created a wordpress site and i am using rest api to display the products n categories in my app

in that i have created a custom cart php file where i am getting the productid n name etc..

i want to add some additonal parameters when the product is added to cart, i saw extra product option plugin in wordpress so how can i integrate my custom cart to extra product option or how to add additional parameters to my cart so i can send the data when user clicks on add to cart in app.

how can i implement this n i m using _woocommerce_persistent_cart_1

below is my php code

<?php

/**
 * REST API Webhooks controller
 *
 * Handles requests to the /webhooks endpoint.
 *
 * @package Automattic/WooCommerce/RestApi
 * @since   2.6.0
 */

defined( 'ABSPATH' ) || exit;

/**
 * REST API Webhooks controller class.
 *
 * @package Automattic/WooCommerce/RestApi
 * @extends WC_REST_Webhooks_V2_Controller
 */
class WC_REST_Webhooks_Controller extends WC_REST_Webhooks_V2_Controller {

    /**
     * Endpoint namespace.
     *
     * @var string
     */
    protected $namespace = 'wc/v3';

    /**
     * Get the default REST API version.
     *
     * @since  3.0.0
     * @return string
     */
    protected function get_default_api_version() {
        return 'wp_api_v3';
    }
    
    protected $rest_base = 'custom';

    function woocomm_add_to_cart($param) {

        global $wpdb;
        $user_id = $param('user_id');
        wp_set_current_user($user_id);

        $objProduct = new WC_Session_Handler();     
        $wc_session_data = $objProduct->get_session($user_id);
        
        // Get the persistent cart may be _woocommerce_persistent_cart can be in your case check in user_meta table
        $full_user_meta = get_user_meta($user_id,'_woocommerce_persistent_cart_1', true);

        if ( defined( 'WC_ABSPATH' ) ) {
            // WC 3.6+ - Cart and other frontend functions are not included for REST requests.
            include_once WC_ABSPATH . 'includes/wc-cart-functions.php';
            include_once WC_ABSPATH . 'includes/wc-notice-functions.php';
            include_once WC_ABSPATH . 'includes/wc-template-hooks.php';
        }

        if ( null === WC()->session ) {
            $session_class = apply_filters( 'woocommerce_session_handler', 'WC_Session_Handler' );

            WC()->session = new $session_class();
            WC()->session->init();
        }

        if ( null === WC()->customer ) {            
            WC()->customer = new WC_Customer( get_current_user_id(), true );
        }
        
        if ( null === WC()->cart ) {
            WC()->cart = new WC_Cart();

            // We need to force a refresh of the cart contents from session here (cart contents are normally refreshed on wp_loaded, which has already happened by this point).
            WC()->cart->get_cart();
        }
        
        // create new Cart Object
        $cartObj = WC()->cart;
        
        
        // Add old cart data to newly created cart object
        if($full_user_meta('cart')) {           
            foreach($full_user_meta('cart') as $sinle_user_meta) {              
                $cartObj->add_to_cart( $sinle_user_meta('product_id'), $sinle_user_meta('quantity'), $sinle_user_meta('variation_id')  );
            }
        }
    
        // Add product and quantities coming in request to the new cart object
        if($param('products')){
            WC()->cart->empty_cart();
            foreach($param('products') as $prod) {
                $cartObj->add_to_cart( $prod('product_id'), $prod('quantity'), $prod('variation_id')  );                
            }
        }
        
        $updatedCart = ();
        foreach($cartObj->cart_contents as $key => $val) {
            unset($val('data'));
            $updatedCart($key) = $val;
        }

        // If there is a current session cart, overwrite it with the new cart
        if($wc_session_data) {
            $wc_session_data('cart') = serialize($updatedCart);
            $serializedObj = maybe_serialize($wc_session_data);


            $table_name = 'wp_woocommerce_sessions';

            // Update the wp_session table with updated cart data
            $sql ="UPDATE $table_name SET session_value= '".$serializedObj."' WHERE  session_key = '".$user_id."'";

            // Execute the query
            $rez = $wpdb->query($sql);
        }
    
        
        // Overwrite the persistent cart with the new cart data
        $full_user_meta('cart') = $updatedCart;

        
        $productsInCart = ();
        foreach($cartObj->cart_contents as $cart_item) {                            
             $product =  $cart_item('variation_id') == 0 ? wc_get_product( $cart_item('product_id') ) : wc_get_product( $cart_item('variation_id') );
             $image_id  = $product->get_image_id();
             $image_url = wp_get_attachment_image_url( $image_id, 'full' );
             $attributes =  $product->get_attributes();
 
             $productsInCart() = (object) (
                "product_id" => $cart_item('product_id'),
                "product_name" => wc_get_product( $cart_item('product_id') )->get_name(),
                "product_regular_price" => $product->get_regular_price(),
                "product_sale_price" => $product->get_sale_price(),
                "thumbnail" => $image_url,
                "qty" => $cart_item('quantity'),
                "attribute" => $attributes,             
                "line_subtotal" => $cart_item('line_subtotal'),
                "line_total" => $cart_item('line_total'),
                 "variation_id" => $cart_item('variation_id'),      
              );
        }
            
        
        update_user_meta(get_current_user_id(), '_woocommerce_persistent_cart_1', array('cart' => $updatedCart, ));         
        
        $response = (
            'status' => true,
            'data' =>  $full_user_meta('cart') != null ?  $productsInCart : ()          
        );

        return rest_ensure_response($response);
    }

    function woocomm_cart_list($param) {
        $user_id = $param('user_id');
        $objProduct = new WC_Session_Handler();

        $wc_session_data = $objProduct->get_session($user_id);

        // Get the persistent cart may be _woocommerce_persistent_cart can be in your case check in user_meta table
        $full_user_meta = get_user_meta($user_id,'_woocommerce_persistent_cart_1', true);
        
        $productsInCart = ();
        foreach($full_user_meta('cart') as $cart_item) {                            
             $product =  $cart_item('variation_id') == 0 ? wc_get_product( $cart_item('product_id') ) : wc_get_product( $cart_item('variation_id') );
             $image_id  = $product->get_image_id();
             $image_url = wp_get_attachment_image_url( $image_id, 'full' );
             $attributes =  $product->get_attributes();
 
             $productsInCart() = (object) (
                "product_id" => $cart_item('product_id'),
                "product_name" => wc_get_product( $cart_item('product_id') )->get_name(),
                "product_regular_price" => $product->get_regular_price(),
                "product_sale_price" => $product->get_sale_price(),
                "thumbnail" => $image_url,
                "qty" => $cart_item('quantity'),
                "attribute" => $attributes,             
                "line_subtotal" => $cart_item('line_subtotal') ?? 0,
                "line_total" => $cart_item('line_total') ?? 0,
                "variation_id" => $cart_item('variation_id'),               
              );
        }
                    
        $response = (
            'status' => true ,              
            'data' =>  $full_user_meta('cart') != null ?  $productsInCart : ()      
        );

        return rest_ensure_response($response);
    }
    
    public function register_routes() {
        register_rest_route(
            $this->namespace,
            '/addtocart',
            array(
                'methods' => 'POST',
                'callback' => array( $this, 'woocomm_add_to_cart' ),
            )
        );
        
        register_rest_route(
            $this->namespace,
            '/cart',
            array(
                'methods' => 'GET',
                'callback' => array( $this, 'woocomm_cart_list' ),
            )
        );
    }
}

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 – New Product Backend Template for Vendors/Employees

I will be running an online store where employees will need to add new variable products to the store regularly. The variable products would all have the exact same variations and pricing values so I am looking to make this process a little easier on my employees.

Is there any way to have a preset template with variations and prices already entered on the backend when employees go to add a new product?

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