WordPress.org

Ready to get started?Download WordPress

Forums

eShop
[resolved] Allow product option / details to contain a single space. (5 posts)

  1. iboxsolutions
    Member
    Posted 1 year ago #

    Hello,

    I noticed you implemented the following fix a while back:

    6.2.15
    * *fixed* product details can no longer have just a single space.

    Would you be able to point me in the direction of how I might 'undo' this fix in the latest version.

    I use eShop to sell images in various formats / sizes, which I have set up as an option set so that I don't have to keep entering them. I set the base product option / details as a space with the price of 0. Example here

    The other option of course would be to not output the product option / detail on the product listing. Again, any advice welcome.

    Thank you in advance.

  2. esmi
    Theme Diva & Forum Moderator
    Posted 1 year ago #

    Please understand that we cannot provide free support for hacks to any of the eShop scripts. Nor can we help you troubleshoot your hacks. We simply don’t have the time. The plugin is free but we have to spend most of our time trying to earn a living.

    If you are a coder, all we can suggest is that you refer to the code & its comments.

  3. iboxsolutions
    Member
    Posted 1 year ago #

    Thank you for your reply, I appreciate your position.

    Best wishes,

    Tim

  4. iboxsolutions
    Member
    Posted 1 year ago #

    Just in case anyone else is looking to achieve the same thing and wants to be able to set blank product options (i.e. using a single space), here is the solution:

    Edit eshop-product-entry.php

    Find the following code at the bottom of the file (line 367-378):

    if($stkav=='1' && (trim($eshop_product['sku'])=='' || trim($eshop_product['description'])=='' || trim($eshop_product['products']['1']['option'])=='' || trim($eshop_product['products']['1']['price'])=='')){
    		delete_post_meta( $id, '_eshop_stock');
    		add_filter('redirect_post_location','eshop_error');
    	}
    	if($stkav=='0' && trim($eshop_product['sku'])=='' && trim($eshop_product['description'])=='' && trim($eshop_product['products']['1']['option'])=='' && trim($eshop_product['products']['1']['price'])==''){
    	//not a product
    		delete_post_meta( $id, '_eshop_stock');
    		delete_post_meta( $id, '_eshop_product');
    	}
    	return;
    }
    ?>

    Replace with the following code (taken from a previous version of eShop):

    if($stkav=='1' && ($eshop_product['sku']=='' || $eshop_product['description']=='' || $eshop_product['products']['1']['option']=='' || $eshop_product['products']['1']['price']=='')){
    		delete_post_meta( $id, '_eshop_stock');
    		add_filter('redirect_post_location','eshop_error');
    	}
    	if($stkav=='0' && $eshop_product['sku']=='' && $eshop_product['description']=='' && $eshop_product['products']['1']['option']=='' && $eshop_product['products']['1']['price']==''){
    	//not a product
    		delete_post_meta( $id, '_eshop_stock');
    		delete_post_meta( $id, '_eshop_product');
    	}
    	return;
    }
    ?>
  5. elfin
    Moderator
    Plugin Author

    Posted 1 year ago #

    we DO NOT recommend you ever edit core files of the plugin as they will get overwritten the next time you upgrade.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.