product

All Addtional Attributes for Grouped Products in Magento

喜夏-厌秋 提交于 2019-12-04 11:42:50
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 as $_item): ?> <tr> <td><?php echo $this->htmlEscape($_item->getName()) ?></td> <!-- important problem

Magento: template based on attribute set

折月煮酒 提交于 2019-12-04 11:37:32
I want to create different product views based on the attribute set the product belongs to: does Magento provide a way to do this? - UPDATE - Following dan.codes suggestion I've added $update->addHandle('PRODUCT_ATTRIBUTE_SET_ID_'.$product->getAttributeSetId()); to Mage_Catalog_ProductController (I duplicated ProductController.php and put it in local/Mage/Catalog/controllers/). Then I added this to catalog.xml <PRODUCT_ATTRIBUTE_SET_ID_9> // PRODUCT ID of Book Attribute Set <label>Catalog Product View (Book)</label> <reference name="product.info"> <block type="catalog/product_view_type_book"

Get Simple Product from Configurable in Cart

心已入冬 提交于 2019-12-04 11:22:59
问题 I'm trying to load the simple products that have been added to a customer's cart, but when I retrieve the items, it's showing the parent configurable. $cart = Mage::getSingleton('checkout/cart'); $productIds = array(); foreach ($cart->getQuote()->getAllVisibleItems() as $item) { $productIds[] = $item->getProduct()->getId(); } var_dump($productIds); For instance, this will return all the same configurable id when I've added a small, medium, and large to my cart. How can I get the individual

Magento: product specfic designs through 'Custom Layout Update'

Deadly 提交于 2019-12-04 09:38:08
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 need to be able to do this in the product settings. Found the answer: <reference name="product.info">

Add custom content to WooCommerce product description

好久不见. 提交于 2019-12-04 09:06:09
I'm trying to inject some text in my description ending. Is it possible with filter? Or do i need to do this via child theme? Been trying to find the hook for description but can only find one for short description. Example: This is a description. Just some sample text to fill the description out. What i want is to inject "This is the last line in the description" So the hole description would look like this. This is a description. Just some sample text to fill the description out. This is the last line in the description The code i have for injecting text before short description is this: add

Add custom dimension fields to each variation settings for variable products

血红的双手。 提交于 2019-12-04 08:20:45
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. With the 2 hooked functions below you will get exactly what you are expecting like in your mock: // Add variation custom

Add checkbox to product type option in Woocommerce backend product edit pages

我怕爱的太早我们不能终老 提交于 2019-12-04 07:51:45
I have added a custom option checkbox in Woocommerce admin product data settings. If I enable that checkbox and save the changes, the value is correctly saved in product meta data, but the checkbox never stay checked . What I am doing wrong? How to get this working as other option checkboxes? My code: function add_e_visa_product_option( $product_type_options ) { $product_type_options[''] = array( 'id' => '_evisa', 'wrapper_class' => 'show_if_simple show_if_variable', 'label' => __( 'eVisa', 'woocommerce' ), 'description' => __( '', 'woocommerce' ), 'default' => 'no' ); return $product_type

Adding custom attribute to WooCommerce shop loop product title

橙三吉。 提交于 2019-12-04 06:39:51
问题 I am attempting to add a custom attribute to the WooCommerce loop. Currently I have the following in my functions file function cc_template_loop_product_custom_attribute() { $abv = $product->get_attribute('pa_alcohol-by-volume'); if (!empty($abv)) { echo get_attribute('pa_alcohol-by-volume'); }; } add_action('woocommerce_shop_loop_item_title', 'cc_template_loop_product_title', 10); The intention is to get display the attribute 'Alcohol by volume' after the product title. However this is not

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

China☆狼群 提交于 2019-12-04 05:58:20
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. 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 unique SKU check then you have to use wc_product_has_unique_sku filter. It will keep the SKU field in both

Replace WooCommerce variable products price range with the min price

女生的网名这么多〃 提交于 2019-12-04 05:30:40
问题 With my Woocommerce webshop, I sell services using variable products and I would like to replace the price range by "Prices starting at" ++ the lowest price. I have tried changing the code in many ways but I didn't get it working. How can I hide price range in Woocommerce and show only the lowest one on variable products? 回答1: The following will replace the variable price range by "Prices starting at" with the lowest price: add_filter( 'woocommerce_variable_sale_price_html', 'custom_variable