Support » Plugin: Food Store - Online Food Delivery & Pickup » Import products and hide price for free add on

  • Resolved mellow1

    (@cdsigns)


    Dear sir / madam,

    We have two questions

    Import
    We currently use the woocommerce import/export feature to add new products to the store. We are doing some testing, but can’t figure out how to do this with your plugin.

    Can you please tell us if it is possible to do import/export with products including the add ons selected? And if so, how we can achieve this?

    No extra cost
    Several of our add ons have no additional costs. For example user can select one of three sauces with the radio button. The price field for the add on is empty. But in the pop up “+€0.00” is shown.

    For add ons with price this is perfect, but for all free add ons, we would like to hide this field like we saw in video

    Can you please help us?

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author WP Scripts

    (@wpscripts)

    Hello @cdsigns

    Thank you for reaching out.

    Import: You can just follow the regular import/export methods for WooCommerce Products. Everything remains the same except the Extras (Addons) which is a custom taxonomy and the taxonomy slug is “product_addon”. You can follow WC doc on how to import custom taxonomies and product associated with CT.

    https://wordpress.org/support/topic/product-import-with-custom-taxonomy-2/

    No Extra Cost: With below code you can hide the prices having value 0.

    function f_wfs_popup_addon_price( $price_html, $addon_id, $raw_price) {
    	if( intval( $raw_price ) == 0 ) {
    		echo '';
    	} else {
    		echo $price_html;
    	}
    }
    add_filter( 'wfs_popup_addon_price', 'f_wfs_popup_addon_price', 10, 3 );

    Hope this helps.

    Regards,
    Team WP Scripts

    Hi,
    @wpscripts
    Is it possible to show the “0” valued addons as “Free” instead of showing 0.00 or Hide the field?
    Thanks in advance.

    Plugin Author WP Scripts

    (@wpscripts)

    Hello @sohom

    You can use the above code and in the IF condition instead of returning blank, you can return a string “Free” or whatever you need. It will work.

    And some changes needed on above code as suggested by another user. On 2nd line of above snippet user floatval instead of intval so that it will work better if your addons having prices in float.

    Regards,
    Team WP Scripts

Viewing 3 replies - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.