Forum has been created to help all our customers in properly working our theme. We offer complete help with configuration theme and make default look, just like on our Be|theme demo. We don`t offer theme customization.


Before creating a new discussion, please:
1. Check on forum if discussion hasn`t been created before. Use the forum Search on the right.
2. Read carefully the documentation included to package.
3. If you didn`t find what you need and would like to post a new question click the "Start a New Discussion" button on the right.
4. You can post on forum only after registration (you need purchase code to register) .


NOTE!!! If you are starting a new topic and have got problems with your site and you want us to check what`s wrong please always give url to your site because without that we can`t check what`s wrong. Each case may be different because of your installed plugins, servers or other things.


IMPORTANT!!! Along with your inquiry, please attach the address of the page which concerns the question. This will cause the time to answer on your question will be much shorter. If you do not want to publish your address publicly in the forum, please send a private message. Thanks!

Inconsistent behavior for visibility of the Add to Cart button/link

In WooCommerce, the "Add to Cart" button is visible on the single product page when the product is purchasable and it is in stock. See woocommerce\templates\single-product\add-to-cart\simple.php for reference. In BeTheme, the Add to Cart link is visible when the product is in stock and regardless of the product's purchasable property. See themes\betheme\woocommerce\content-product.php for reference. When the Add to Cart link is clicked for the product that is in stock but with empty price, an error message is displayed that the product cannot be added to the cart. 

Please make the behavior of the Add to Cart link and the Add to Cart button consistent.

Comments

  • Please sign in to see answear!
  • edited September 4
    Thanks for the quick replay. I just updated BeTheme to the latest version, disabled plugins and can still reproduce the issue.
    I am pretty sure it is caused by missing check for product->is_purchasable() in \betheme\woocommerce\content-product.php line 31.

    Could you see if you can reproduce the issue using the hook below? The hook forces product->is_purchasable() to return false regardless of the product price.

    function custom_woocommerce_is_purchasable($product){
        return false;
    }
    add_filter('woocommerce_is_purchasable', 'custom_woocommerce_is_purchasable');

    With the hook applied the Add to Cart icon is still showing up for products. (see http://prntscr.com/kqf3ob), but there is no Add to Cart button on the product detail page. See http://prntscr.com/kqf3v3

  • Please sign in to see answear!
  • edited September 4
    Is it feasible for you to share the URL and credentials of the BeTheme web site where I can help to reproduce the issue?

    Below are more details on how to reproduce it. 

    1) Create a new simple product. Do not enter any price, but change the stock status to out of stock.
    2) Publish the product and view it.
    3) Make sure the Add to Cart button is not visible on the product detail page. It is expected because the product is not purchasable. http://prntscr.com/kqhhwf
    4) Now create one more simple product. Give it a name and also add the product from item#1 to Up sells. Publish it and then view it. 
    5) Notice that in the "You may also like" section the product from item #1 is showing up. There is also the Add to Cart icon. http://prntscr.com/kqhmap ;This is not expected. When the icon is clicked, an error message is displayed that the product cannot be added to the cart. http://prntscr.com/kqhmyx

    A bit of technical details, the content for the product detail page comes from woocommerce\templates\single-product\add-to-cart\simple.php. The content for the "You may also like" section comes from \betheme\woocommerce\content-product.php. 
  • Please sign in to see answear!
Sign In or Register to comment.