product

WooCommerce Variable Product notice Issue - please choose product options

无人久伴 提交于 2019-12-23 23:22:38
问题 I'm building an e-commerce site. I'm having some trouble with WooCommerce Variable Product . The "Add to Cart" button works fine with simple products, but does not work with variable products. It gives a "Please choose product options…" notice. I looked everywhere and tried several suggestions online, none of them work. So I looked into WooCommerce source file: class-wc-form-handler.php . In the function add_to_cart_handler_variable : function add_to_cart_handler_variable( $product_id ) {

Display only enabled products in magento my wishlist

耗尽温柔 提交于 2019-12-23 21:49:12
问题 When users login and click on my wishlist link it display the products. But it display the disabled products also. I want to display only the enabled products in wishlist. Can any one suggest me how to make changes in code so that it will display only enabled products in my wishlist area. 回答1: You probably have to extend this class Mage_Wishlist_Model_Wishlist and override the method getItemCollection by adding a filter by status. Something like this (untested, just added the last method call

WooCommerce checkout message based on specific product category

浪尽此生 提交于 2019-12-23 17:29:42
问题 Wordpress store is using WooCommerce, and I have a small purchase note that I need to appear on WooCommerce Checkout , but only when a certain product is being purchased. I have added a custom message that now appears below the Place Order button. However its showing up no matter what is in the cart. This is the code I currently have in place: add_action( 'woocommerce_after_checkout_form', 'allclean_add_checkout_content', 12 ); function allclean_add_checkout_content() { echo '<div class=

Magento changing the dropdown configurable product options for divs

余生颓废 提交于 2019-12-23 10:17:38
问题 I need to show the options of a configurable product as divs with an "a" inside that let the user perform a click in the option and select it, instead of a dropdown list. Like a menu (the goal is to show shoe sizes). As many of you know, Magento uses a Json response to fill the options of the dropdown menu. (var spConfig = new Product.Config(getJsonConfig() ?>) and the class is located in js/varien/product.js (Product.Config = Class.create() ). Then, what I did was to edit the file template

How to upload image of product from front end in magento

假装没事ソ 提交于 2019-12-23 09:02:17
问题 I'm trying to upload the image of the product in admin panel. It's working fine but now I want to upload the image of the product in front end. I mean customer can upload the image of the product from the front end. So how this is possible? 回答1: First upload image in media/import if(isset($_FILES['file']['name']) && $_FILES['file']['name'] != '') { $fileName = $_FILES['file']['name']; $fileExt = strtolower(substr(strrchr($fileName, "."), 1)); $fileNamewoe = rtrim($fileName, $fileExt);

Get the count of newly published product (today) in WooCommerce [closed]

谁都会走 提交于 2019-12-23 05:37:10
问题 Closed . This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this post. Closed 2 years ago . I have a WooCommerce site where products are considered as trade/deal. Therefore, when someone take a trade (buy a product), it become out of stock. How to display the number of products that has been published today (the new ones)? ex: 4 New Trades (products) Published Today 回答1:

Add a barcode field to Product Inventory in WooCommerce

ε祈祈猫儿з 提交于 2019-12-23 04:35:53
问题 I would like to add a Barcode Field under my SKU code field in my Inventory settings of my Product. I'd like to use this as I'm working with WooCommerce POS and based on the barcode field I could do a scan, but still use the SKU fields for the real SKU codes. How can I accomplish this without the use of any plugins. (Read: Function.php code). I already tried using the following code, but without any success: //Add barcode to the product inventory tab add_action('woocommerce_product_options

Set custom product sorting as default Woocommerce sorting option

守給你的承諾、 提交于 2019-12-23 04:19:24
问题 In Woocommerce, I ma using the following code that adds a custom sorting option to shop catalog by modified date. add_filter( 'woocommerce_get_catalog_ordering_args', 'enable_catalog_ordering_by_modified_date' ); function enable_catalog_ordering_by_modified_date( $args ) { if ( isset( $_GET['orderby'] ) ) { if ( 'modified_date' == $_GET['orderby'] ) { return array( 'orderby' => 'modified', 'order' => 'DESC', ); } } return $args; } add_filter( 'woocommerce_catalog_orderby', 'add_catalog

Where to change Magento default tabs on products?

最后都变了- 提交于 2019-12-23 03:51:11
问题 I am struggling with a problem that I hope you can be helpful with. I need to change the default product tabs on my product page, but I can't change it in the backend, only set the different attributes. I have narrowed it down to a catalog.xml file, but I don't know where the exact code is controlling the tabs. I tried to alter the code a bit, but with no effect. My Magento installation is also very slow, which is driving me mad... Any ideas? Thanks in advance... 回答1: I would suggest you to

Rename Length to Diameter in WooCommerce formatted product dimensions output

久未见 提交于 2019-12-23 03:21:22
问题 I’m using this woocommerce_format_dimensions filter hook to replace displayed dimensions format from 1 x 1 x 1 in to 1 L in. x 1 W in. x 1 H in. add_filter( 'woocommerce_format_dimensions', 'custom_formated_product_dimentions', 10, 2 ); function custom_formated_product_dimentions( $dimension_string, $dimensions ){ if ( empty( $dimension_string ) ) return __( 'N/A', 'woocommerce' ); $dimensions = array_filter( array_map( 'wc_format_localized_decimal', $dimensions ) ); foreach( $dimensions as