product

Magento 1.9 change custom option value depending on stock number

我是研究僧i 提交于 2019-12-11 15:21:53
问题 I have custom code that determines if a custom code value exists and if it does to select this option over the default sort order option in the product config. What I am wanting to do is further add logic that if the product sku starts with "F" then it will show the default sort order value for that product. The custom code is in this file.. app\code\local\Mage\Catalog\Block\Product\View\Options\Type\Select.php Here is the code in question // Set Default for the following cases: // Ring Size

Mixed currency products in Magento

谁说胖子不能爱 提交于 2019-12-11 15:10:35
问题 I'm evaluating if Magento will be suited to a particular client. They have an unusual requirement where their products may have two price components, one in AUD and one in reward points. There are three combinations of prices: all AUD, all reward points and a fixed mix of both. I was wondering if Magento supports such a scenario? That is, can it have products flowing through to the shopping cart which have multiple currencies? My research indicates you can have different currency prices per

change number of columns/ products per row for specific woocommerce product category in php

邮差的信 提交于 2019-12-11 15:06:07
问题 I am using Woocommerce 3.3.3 and trying to change the number of columns for a specific product category and not the other product categories. I have tried several code options, but they all apply the change in columns to all categories. Here is one of thing I've tried. /* change columns to 1 for newsletter issues prod cat*/ add_filter('loop_shop_columns', 'loop_columns'); if (!function_exists('loop_columns')) { function loop_columns() { if ( is_product_category('newsletter-issues')) { return

Magento - Adding multiple products to cart programatically

冷暖自知 提交于 2019-12-11 14:08:57
问题 In a bit of a pickle trying to get multiple products to add to cart, effectively I have a block with a form element that defines the products that are added to the cart (free products, which is handled with an observer event). The observer event to change the products price to free is working fine however, adding more than one product to the cart is proving troublesome with the following method: public function addFreeItems($observer) { $cart = Mage::getSingleton('checkout/cart'); $freeItems

Configurable product options not showing the options on Frontend

浪尽此生 提交于 2019-12-11 12:57:49
问题 I am having problems with the configurable products not showing the options on the frontend. If I use the default theme that came with magento (rwd), all the options are there and working great. But if I select my custom theme, the dropdown options shows nothing but the default "choose an option..." I have tried most of the troubleshooting but still the problem persist. Console errors. By the way, my custom theme is based on rwd built-in theme in magento. I only modified most of the styles

Remove WooCommerce image

依然范特西╮ 提交于 2019-12-11 11:40:31
问题 As directed here, I inserted the following code to stop my product images from showing at full width with WooCommerce. .single-product .product .summary { width: 100% !important; float: none !important; } Since I update my theme/Woocommerce, this code no longer works (the product image still appears). Please help me with code to remove the product image. 回答1: I figured it out myself. In wc-template-hooks.php ("WEBSITE"/wp-content/plugins/woocommerce/includes) I changed: add_action(

MySQL Search Query - “Keep” not working

强颜欢笑 提交于 2019-12-11 11:39:51
问题 Im a little confused with the follow query we have been using for a while, The following works Search query for "fire" SELECT product FROM product_descriptions WHERE MATCH(product) AGAINST('+fire*' IN BOOLEAN MODE) LIMIT 5 Returns Fire Storage 31020 S1 E Fire Storage 31020 S1 K Fire Storage 31021 S1 E Fire Storage 31021 S1 K Fire Storage 31022 S1 E However the following search query for "keep" SELECT product FROM product_descriptions WHERE MATCH(product) AGAINST('+keep*' IN BOOLEAN MODE)

Hide “remove item” from cart for WooCommerce product category

时光毁灭记忆、已成空白 提交于 2019-12-11 11:31:20
问题 I would like to Hide "remove item" from cart for a specific product category in WooCommerce, just like in "Hide "remove item" from cart for a specific product in WooCommerce" answer thread, but for a specific product category. Any help would be appreciated. 回答1: The following code will hide "remove item" from cart for a specific product category (that you will define in the 2nd function) : // Custom conditional function that checks for categories (including parent) function has_product

Add programmatically a downloadable file to Woocommerce products

我是研究僧i 提交于 2019-12-11 08:46:16
问题 In my solution I want to automate the product creation as much as possible. One time saver is, in my opinion, to auto add the downloadable file to the product. I have created this function: function fcsp_add_downloadable_file($post_id, $post, $update){ $post_thumbnail_id = get_post_thumbnail_id( $post_id ); $url = get_site_url()."/wp-content/uploads/".get_the_date('Y')."/".get_the_date('m')."/".$filename_only = basename( get_attached_file( $post_thumbnail_id ) ); update_post_meta($post_id, '

Customs product price on sale displayed with date limit in Woocommerce 3+

让人想犯罪 __ 提交于 2019-12-11 07:52:08
问题 I have code which prints text after the price when on sale and I am now getting an error using this code, which I did not get before. It says: "PHP Warning: date() expects parameter 2 to be integer" and it refers to this line: $sales_price_date_to = date( "j.M.Y", $sales_price_to ); Any ideas on how to fix it? add_filter( 'woocommerce_get_price_html', 'custom_price_html', 100, 2 ); function custom_price_html( $price, $product ){ global $post; $sales_price_to = get_post_meta( $product->id, '