product

All Addtional Attributes for Grouped Products in Magento

匆匆过客 提交于 2019-12-06 08:27:13
问题 Similar to the question asked at: Magento - Show Custom Attributes in Grouped Product table I'd like to display attributes of simple products in the grouped product page. However, I need it to work such that you do not explicitly specify which attributes get displayed. Instead, it displays all the attributes that would get displayed on the simple product view of that product. I've tried variations of: (from /template/catalog/product/view/type/grouped.phtml) <?php foreach ($_associatedProducts

Remove conditionally Woocommerce cart items based on a specific product

徘徊边缘 提交于 2019-12-06 08:03:57
A specific WooCommerce product can only be by itself in the cart. So how do I clear the cart while adding this specific product to the cart? and how can I remove this specific product from the cart when adding any other product? I've figured out how to empty the cart when adding a specific product but I don't know how to remove this specific product from the cart when adding any other product. The following will remove conditionally cart items based on a specific product: When the specific product is added to cart, all other items are removed. When any other product is added to cart, it

Prestashop: How to get accessories for product

此生再无相见时 提交于 2019-12-06 07:39:23
how can I get accessories for each product? In a loop: {foreach $products as $product} // get accessories {/foreach} The problem is that the module HomeFeatured doesn't retrieve accessories for products so they aren't available in the template. You have the choices : edit the PHP code of the module : simple but not upgrade proof duplicate the module to myhomefeatured : easy too but less, and upgrade proof I prefer the 2nd, more future proof & you can add more and more logic after if you need. Whatever you choose, here the modified code of hookDisplayHome to ahve a Smarty variable $accessories

Woocommerce Shortcodes Pagination

北城以北 提交于 2019-12-06 05:47:47
been trying to figure out how to create a loop to support woocommerce's shortcode WITH Pagination. Because currently, I have a project and would like to have a page with a certain product displayed, for example i have 50 sale products, using this shortcode [sale_products per_page="10"] it just displays 10 products without pagination. Any thoughts regarding this issue? Regards, add_action( 'pre_get_posts', 'so_28367762_pre_get_posts' ); function so_28367762_pre_get_posts( $q ) { // We only want to affect the main query if ( is_admin() || ! $q->is_main_query() ) { return; } $sale_page_id = 487;

Magento: product specfic designs through 'Custom Layout Update'

梦想与她 提交于 2019-12-06 04:07:49
问题 If I want to control how each product is displayed (i.e. a custom design when specified) my first thought is to do this: Create a custom view.phtml in template/catalog/product/ my_view.phtml Navigate in the admin to Product->Design->Custom Layout Update Add this block: <reference name="content"> <action method="setTemplate"> <template>catalog/product/view_print.phtml</template> </action> </reference> But the template is never loaded, only the default view.phtml. Is this the correct method? I

Hide product prices and add-to-cart buttons but not variations for unregistered users in WooCommerce

£可爱£侵袭症+ 提交于 2019-12-06 03:20:55
In my WooCommerce shop I want to hide the prices until the customer has logged in. I've got the following code working that does exactly that: add_action('init','hide_price'); function hide_price(){ if(!is_user_logged_in()){ remove_action('woocommerce_after_shop_loop_item','woocommerce_template_loop_add_to_cart',10); remove_action('woocommerce_single_product_summary','woocommerce_template_single_add_to_cart',30); remove_action('woocommerce_single_product_summary','woocommerce_template_single_price',10); remove_action('woocommerce_after_shop_loop_item_title','woocommerce_template_loop_price',10

Add custom dimension fields to each variation settings for variable products

主宰稳场 提交于 2019-12-06 02:57:54
问题 I'm trying to add a "Built Dimensions" fields to each product variation settings. Here's a mock of what I'm trying to accomplish: I've followed these following tips but they aren't doing quite what I want: http://www.remicorson.com/mastering-woocommerce-products-custom-fields/ Add Advanced Custom Fields to WooCommerce Product Variation Those are adding it to one of the other data tabs. I need it per variation. Each variation has a built dimension and a shipping dimension. 回答1: With the 2

Custom templates in Woocommerce 3

久未见 提交于 2019-12-06 02:28:33
I'm trying to make a separate template for only one product with ID 5555. To delete a photo from its page and change the blocks structure. Overriding this file affects all product pages. wp-content\plugins\woocommerce\templates\content-single-product.php The logical solution is to add a condition: if the product single prpduct page have ID 5555, then another template is used for its page. I tried this option, but it does not work. /** * Custom single product template. */ add_filter( 'single_template', 'get_custom_post_type_template' ); function get_custom_post_type_template($single_template) {

How to create multiple simple-products with same SKU in WooCommerce?

做~自己de王妃 提交于 2019-12-06 01:08:50
问题 I want to create multiple simple-product with same SKU in WooCommerce. I search in admin settings but there I cannot find any settings to enable this features. Is there any hook so I can disable this features. 回答1: If you want to completely disable the SKU feature then you have to use wc_product_sku_enabled filter. It will remove the SKU field from both backend and frontend. add_filter( 'wc_product_sku_enabled', '__return_false' ); If you want to keep the SKU feature but need to disable

Implement multiple product chooser widget Magento

爷,独闯天下 提交于 2019-12-06 00:27:12
Hi I need to implement a multiple product chooser widget in magento. For this I am using the below code. With this a I can put a multiple sku for the products in the field in admin. But I need to implement a product chooser with a checkboxes so that I can check those and submit. Please check the screenshot here http://www.awesomescreenshot.com/0035hy791a app/code/community/Speroteck/SelectedProductsBlock/etc/config.xml <config> <modules> <Speroteck_SelectedProductsBlock> <version>0.1.0</version> </Speroteck_SelectedProductsBlock> </modules> <global> <helpers> <speroteck_selectedproductsblock>