how add css class to product boxes li, for img, add cart button, decs, price… [closed]

You don’t need to add class to those elements. You can apply CSS style to those elements by using following selectors respectively. .post-type-archive-product ul.products li.product .post-type-archive-product ul.products li img .post-type-archive-product ul.products li .button .post-type-archive-product ul.products li .woocommerce-loop-product__title .post-type-archive-product ul.products li span.woocommerce-Price-amount.amount

How to get the WooCommercer product variation image

here is product set in display in cart in cart.php $_product = apply_filters( ‘woocommerce_cart_item_product’, $cart_item[‘data’], $cart_item, $cart_item_key ); $product_id = apply_filters( ‘woocommerce_cart_item_product_id’, $cart_item[‘product_id’], $cart_item, $cart_item_key ); $thumbnail = apply_filters( ‘woocommerce_cart_item_thumbnail’, $_product->get_image(), $cart_item, $cart_item_key ); if ( ! $_product->is_visible() ) { echo $thumbnail; } else { $thumb = wp_get_attachment_image_src( get_post_thumbnail_id($_product->id), ‘thumbnail’ ); $cartimgsrc=UNAVAILABLEIMG; if($thumb[0]){ $cartimgsrc=$thumb[0]; $product … Read more

Admin Order adding an extra product on add_line_item

So i manage to solve the problem myself after looking little more around, the hook is super poorly named. But it does the trick! It fires after the order is created, so you can manipulate the order as you wish. add_action(‘woocommerce_process_shop_order_meta’, woocommerce_process_shop_order’, 10, 2); function woocommerce_process_shop_order ($post_id, $post) { global $woocommerce; $oOrder = new WC_Order($post_id); … Read more

How to allow registration only from a certain location?

The googles suggested several ways to do this, either with PHP or jQuery. Here’s one article I found to get you started: http://tutorialzine.com/2016/06/quick-tip-detecting-your-location-with-javascript/ Plus there is this Stackoverflow answer that might help: https://stackoverflow.com/questions/40636671/how-to-setup-the-functionality-to-get-user-location-in-browser “Geolocation” is a good search term to use. You’ll need to customize you registration form to enable this, but perhaps these links … Read more

Cross-sells on WooCommerce product page

Here’s my solution to this. In my situation, the “Related Products” section didn’t make sense (as the store was already organized based on categories), so I removed the standard related products section and re-added it with the same template, but by feeding the template the cross-sells instead of the related products. The section still says … Read more

I’m trying to display product categories on each product in the list

Product categories in Woocommerce is a term, so you can get the categories with get_the_terms function: echo ‘<h3><a href=”‘ . get_the_permalink() . ‘”>’ . get_the_title() . ‘</a></h3>’; echo ‘<span style=”display:none;” class=”prodcat’; $categories = get_the_terms( get_the_ID(), ‘product_cat’ ); foreach ($categories as $category) { echo ‘ ‘ . $category->name . ”; }; echo ‘”> </span>’;

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)