product

Magento: HOW-TO add active products in a drop-down in Main Navigation Menu

故事扮演 提交于 2019-12-01 11:16:11
Instead of categories I would like products to appear in the drop-down navigation menu similar to lowes.com . Is this possible? I am not paying for anything either :) I've attempted to alter core/Mage/Catalog/Block/Navigation.php and try to 'fake' products as categories but the object requirement is very specific. Since the function to create the menu is recursive it will only work on actual categories and nothing else. Any ideas? I know another option is to create 2nd level categories and name them as my products and then do a rewrite in .htaccess but this is not dynamic and very messy. After

Woocommerce - Move add to cart button variable product

谁说胖子不能爱 提交于 2019-12-01 11:12:19
问题 I am working on a custom theme. I need to move the add to cart button from the woocommerce_single_variation (variable.php) section into the woocommerce_after_single_product_summary (content-single-product.php) section. I have been able to do this by adding the following to my functions.php file. function remove_loop_button(){ remove_action( 'woocommerce_single_variation', 'woocommerce_single_variation_add_to_cart_button', 20 ); } add_action('init','remove_loop_button'); add_action(

Meta box with a wysiwyg field displayed on Woocommerce single product custom tabs

旧街凉风 提交于 2019-12-01 10:58:31
问题 Need to display a custom fields in the related products on a single product page. I would like to add a meta box to the Add New Product fields and display results on custom tab on single product page under reviews.I tried using code but nothing shows on the page. Adding extra product tab helps me in adding extra information. So adding, saving and displaying product is what I am looking for. add_filter( 'add_meta_boxes', 'bhww_core_cpt_metaboxes' ); function bhww_core_cpt_metaboxes( $meta

Total purchase count by product for current user in Woocommerce

ⅰ亾dé卋堺 提交于 2019-12-01 10:50:39
In Woocommerce, I would like to show the total purchase product count for the current user in single product pages. Like for example if John bought a Pen 2 times then it displays the count ("2") in this product page for John user and if Jack bought it 5 times then it will show 5 in this product page for Jack user. I don't want print total sold count, I want to show as per current logged in user. My actual code in function.php file: add_action( 'woocommerce_single_product_summary', 'wc_product_sold_count', 11 ); function wc_product_sold_count() { $get_current_pro_id = $_SESSION["iddd"]; global

Python itertools.product with arbitrary number of sets

放肆的年华 提交于 2019-12-01 10:44:25
I wish to execute the following code: temp = [] temp.append([1,2]) temp.append([3,4]) temp.append([5,6]) print list(itertools.product(temp[0],temp[1],temp[2])) However, I would like to execute it for temp with arbitrary length. I.e. something more like: print list(itertools.product(temp)) How do I format the input correctly for itertools.product to produce the same result in the first segment of code without explicitly knowing how many entries there are in temp? print list(itertools.product(*temp)) Use * to unpack the argument iterable as separate positional arguments. Or can do that: Combine

Sort Woocommerce Products from a product category and custom meta_key

本秂侑毒 提交于 2019-12-01 10:37:36
问题 Im successfully filtering ALL my Wordpress posts by Likes (count) with a Custom Plugin (and meta_key) wich also let me filter the most liked posts in categories. I display (query) the result in a custom page template. Everything works fine. The Like function works also on Woocommerce Products. But so far i was not able to set up a page where i sort the Products (post_type) the same way in a specific shop cateogry as i do it with my posts. The closest i came was to display the most liked posts

Rename Description tab in Woocommerce single product page

两盒软妹~` 提交于 2019-12-01 10:34:33
I pasted this code in function.php, but it didn't rename the product page tab as it supposed to ( http://www.noushasasart.com/product/harsh-bark/ ) function woo_remove_product_tabs($tabs) { unset($tabs['reviews']); // Remove the reviews tab $tabs['description']['title'] = __('Additional Information'); // Rename the description tab return $tabs; } how can I solve this? You have forgotten the filter hook: add_filter( 'woocommerce_product_tabs', 'woo_customize_tabs', 100, 1 ); function woo_customize_tabs( $tabs ) { unset($tabs['reviews']); // Remove the reviews tab $tabs['description']['title'] =

How do I get all combinations of data from a MySQL table?

谁说胖子不能爱 提交于 2019-12-01 09:02:15
I have spent the last five hours trying to get every product option combination from a table but I'm totally stuck now. I have a table with data like (simplified): CREATE TABLE `assigned_options` ( `option_id` int(10) unsigned NOT NULL DEFAULT '0', `value_id` int(10) unsigned NOT NULL DEFAULT '0', ); INSERT INTO `assigned_options` (`value_id`, `option_id`) VALUES (4, 2), (3, 2), (2, 1), (1, 1), (5, 3), (6, 3), (7, 3); Say option ID 2 is color with variations red (4) and blue (3), option id 1 size etc.... Is it possible to do this with one MySQL query? I have tried using PHP to make a recurring

Magento mass-assign products to category

旧时模样 提交于 2019-12-01 08:51:23
As the title says,i need to mass-assign products to a category and from the admin i can only edit one product at a time; i dont know why it just doesnt work to mass add them from the "category products" tab in the category page. Thats why i need another method that's fast,like using phpMyAdmin or something alike. Any help? Thanks in advance! I created a simple script to do this outside of Magento. Be sure to test this first on a single product and make sure it looks as you'd expect. // Load Magento require_once 'path/to/app/Mage.php'; Mage::app(); // $productIds is an array of the products you

Displaying Advanced Custom Field (ACF) value in a WooCommerce hook

跟風遠走 提交于 2019-12-01 08:37:26
问题 I want to display the value from an Advanced Custom Field (ACF) in Woocommerce and I am using this code in this function hooked: add_action( 'woocommerce_single_product_summary', 'charting', 20 ); function charting() { if( get_field('size_chart') ) { echo '<p><a href="'.the_field('size_chart').'" data-rel="prettyPhoto">size guide</a></p>'; } return; } But it is not working, it is displaying the custom field value above the href (size guide) and the href is empty like this: <a href="" data-rel