Page 1 of 2 12 LastLast
Results 1 to 10 of 11
  1. #1
    Join Date
    Oct 2010
    Location
    Idaho
    Posts
    292
    Plugin Contributions
    0

    Default Buy Now button consistency

    --- This post might also be considered for the ZC improvements/bugs forum, though not so much a bug as an inconsistency in button/link text display ---

    * This is core ZC code -- issue is not due to custom template code -- screen shot attached *

    On a product listing, such as the All Products listing, a sold out item displays the little sold out button instead of buy now button (items w/o attributes), so that is perfect, but the sold out listing has an extraneous '... more info' link right above the sold out button. There is also a '... more info' link over to the right, as expected.

    Okay, so the difference between that overall display and the display for a product that can be sold, is the extraneous (duplicate) '... more info' link -- it is not suppressed the way it is suppressed when the product can be sold and only a single '... more link' appears.

    I'm simply not an experienced enough coder to (completely) understand how the sold button gets called instead of the 'buy now' button, but it looks a little complicated. There are functions in functions_general that switch the button to be displayed from the 'buy now' button to the 'sold out' button (about lines 1074 and 1140) and then there are the regular module and template files that put everything together. I'm not good enough w/ code to see how $return_button (or maybe it's $display_button) gets passed the substitution, but the operation is in there somewhere.

    My question is this: would it be simple to suppress the extraneous '... more info' link when the little 'sold out' button gets triggered? And if so, could the suppression be done in a central location to command all types of listing pages? Thank you.

    Some or all of the files that control this display:
    tpl_modules_products_all_listing.php
    product_listing.php
    functions_general.php
    tpl_products_all_default.php
    Attached Images Attached Images  

  2. #2
    Join Date
    Oct 2010
    Location
    Idaho
    Posts
    292
    Plugin Contributions
    0

    Default Re: Buy Now button consistency

    We also have a double '... more info' link on a product w/ attributes, but maybe this is by design?

    <image attached>
    Attached Images Attached Images  

  3. #3
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default Re: Buy Now button consistency

    Couple problems on changing this ...

    Take for example the All Product listing from the:
    /includes/templates/templates_default/templates/tpl_modules_products_all_listing.php

    around line 99 ...
    Code:
            $products_link = '<a href="' . zen_href_link(zen_get_info_page($products_all->fields['products_id']), 'cPath=' . zen_get_generated_category_path_rev($products_all->fields['master_categories_id']) . '&products_id=' . $products_all->fields['products_id']) . '">' . MORE_INFO_TEXT . '</a>';
    If you take out the MORE_INFO_TEXT and the Product Description is short, then you do not have either MORE_INFO_TEXT showing on the Product ...

    If the Product Description is long, then you have the 2 MORE_TEXT_INFO showing ...

    You could try adding an IF around that line to test the length of the products_description to see if it is longer than what you are displaying and if so, then not add the additional MORE_INFO_TEXT ...
    Linda McGrath
    If you have to think ... you haven't been zenned ...

    Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!

    Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today: v1.5.5]
    Officially PayPal-Certified! Just click here

    Try our Zen Cart Recommended Services - Hosting, Payment and more ...
    Signup for our Announcements Forums to stay up to date on important changes and updates!

  4. #4
    Join Date
    Oct 2010
    Location
    Idaho
    Posts
    292
    Plugin Contributions
    0

    Default Re: Buy Now button consistency

    thanks, Linda,

    I understand your response. I thought there would be an easy way of making the sold out button behave like the buy now button, w/o affecting the 'more info' off to the right (the one based on length of product description).

    In other words, not do anything about the 'more info' off to the right (leave it be to display or not depending on prod desc length), but rather have the sold out button appear instead of 'more info' on the left, just like how the 'buy now' button is coded to appear instead of 'more info' on left.

    I see that there is a whole lot more code controlling whether buy now appears instead of 'more info' on left, than in controlling the call to the sold out button, so maybe that is what would make it difficult to make sold out behave the same way. I'm probably wrong, but it sort of seems that sold out gets triggered if nothing before it gets triggered, sort of like a default, i.e., if none of the code applies, then show sold out. I never could figure out exactly how 'sold out' gets called, other than those two lines in the functions_general file .. but I'm not sure how the outcome of those functions gets passed to the template. I think it has something to do with the $display_button variable, but could never figure it out.

    Even if the prod desc were short, having the 'sold out' behave like the 'buy now,' with respect to suppresssing the 'more info' on the left, would be consistent, because when the prod desp is short (or long, for that matter), the 'buy now' button does not have accompanying 'more info' on left either.

    ahh, it's all academic at this point .. it doesn't really detract or confuse, so ..... who cares, eh?

  5. #5
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default Re: Buy Now button consistency

    All depends on what you want things to look like ...

    You can either leave the Sold Out as is with the more info ... and control if the more info should be added to the description if long *and* quantity > 0 or make it that the Sold Out only adds the more info if the products_description is short ...

    Or ... leave it as it is ...
    Linda McGrath
    If you have to think ... you haven't been zenned ...

    Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!

    Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today: v1.5.5]
    Officially PayPal-Certified! Just click here

    Try our Zen Cart Recommended Services - Hosting, Payment and more ...
    Signup for our Announcements Forums to stay up to date on important changes and updates!

  6. #6
    Join Date
    Oct 2010
    Location
    Idaho
    Posts
    292
    Plugin Contributions
    0

    Default Re: Buy Now button consistency

    huh?

    Seems to be a breakdown in communication here. Perhaps my efforts to be perfectly clear have backfired.

    I've only ever been interested in having the 'sold out' button suppress the 'more info' on the left, in the same way that the 'buy now' button suppresses the 'more info' on the left. The 'more info' on the right was never a part of my inquiry, other than it being present on long descriptions, causing two 'more infos' to appear when the 'sold out' button is showing. I did not ask about, nor was I interested in, tampering with the 'more info' on the right.

    Put another way, it seems that the 'sold out' button should suppress the 'more info' on the left in the same way and for the same reason that the 'buy now' button suppresses the 'more info' on the left. I'm not sure why length of description and amount of quantity have become part of the topic. On a short description w/ qty > 0, there is no 'more info' link anywhere. This is apparently how ZC was designed because in that situation, as when the product description is long, the 'buy now' button suppresses the 'more info' on the left.

    When I started this thread, I was only wanting to know if it was easy (because I couldn't figure out how 'sold out' was getting called) to have the sold out button suppress more info on the left, in the same way that the buy now suppress more info on the left. Period, that's it, just was wondering if it would be easy to get a more consistent look and feel between products in the All list, for example. Both have long descriptions. One is buyable; the other is not. The buyable one suppresses 'more info' on left, so 'more info' won't appear twice, but the sold out product lets 'more info' appear twice. Simple observation. Simple inquiry.

    Are you having a bit of fun with me by intentionally confusing the issue? I honestly don't care anymore about it. I thought I would assist you and your team by bringing something to your attention that may have never been noticed/reported. It would have been nice if you had just responded, "yeah, that makes sense, no reason for two 'more infos' to appear when 'sold out' button appears if there are not two 'more infos' appearing when 'buy now' button appears."

    So much for trying to be helpful. Your product is already perfect in every way so no need to thoughtfully consider earnest input from the community.

  7. #7
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default Re: Buy Now button consistency

    Sorry, the intent was not to confuse you but to explain further how and why the more info appears or does not appear on the left by the Sold Out and the right on the description ...

    I thought that providing you with more details that it might help you decide what to do ...

    I already posted the code where the more info is added to the Sold Out button and thought you could alter that to change things if you needed to ...

    I wanted to make you aware, however, that there will or will not be a more info on the right based on products_description length and that making that change may not be what you are looking for as a Product that is Sold Out with a short Product Description will have no more info at all showing ...
    Linda McGrath
    If you have to think ... you haven't been zenned ...

    Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!

    Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today: v1.5.5]
    Officially PayPal-Certified! Just click here

    Try our Zen Cart Recommended Services - Hosting, Payment and more ...
    Signup for our Announcements Forums to stay up to date on important changes and updates!

  8. #8
    Join Date
    Oct 2010
    Location
    Idaho
    Posts
    292
    Plugin Contributions
    0

    Default Re: Buy Now button consistency

    Thank you, but removing that code looks more like cutting out the 'more info' link on the left instead of suppressing it. Just for the sake of discussion, the code for suppressing 'more info' on the left, when the 'buy now' button appears, looked to be about two dozen lines of code.

    That's why I was so confused before I posted initially -- it didn't seem simple at all to apply the same concept of suppression to the 'sold out' button, and I agree with you .. it does not seem like a good idea to cut the more-info-on-left code out completely. I was just after suppression, but it may be way too complicated.

  9. #9
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default Re: Buy Now button consistency

    Line 99 builds the link for the more info ...
    Code:
            $products_link = '<a href="' . zen_href_link(zen_get_info_page($products_all->fields['products_id']), 'cPath=' . zen_get_generated_category_path_rev($products_all->fields['master_categories_id']) . '&products_id=' . $products_all->fields['products_id']) . '">' . 'xxx' . MORE_INFO_TEXT . '</a>';
    NOTE: the xxx added to see this on the Catalog when Products are Sold Out ...

    Line 100 is trying to get the proper Buy Now button ...

    Code:
            $display_products_button = zen_get_buy_now_button($products_all->fields['products_id'], $the_button, $products_link) . '<br />' . zen_get_products_quantity_min_units_display($products_all->fields['products_id']) . str_repeat('<br clear="all" />', substr(PRODUCT_ALL_BUY_NOW, 3, 1));
    and what that does is passes to the zen_get_buy_now_button the $products_link which is what the zen_get_buy_now_button function should pass back as a link, if the Buy Now/Add to Cart is not allowed for the Product, such as it is Sold Out ...

    So if line 99 was not passing the link with the more info on it to the zen_get_buy_now_button but rather passed it a blank as in comment out the existing line and add below it:
    $products_link = '';

    then the more info link would not show on the Sold Out at all and you would only see a more info on the right based on the length of the Product Description ...

    Does that help clarify this?
    Linda McGrath
    If you have to think ... you haven't been zenned ...

    Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!

    Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today: v1.5.5]
    Officially PayPal-Certified! Just click here

    Try our Zen Cart Recommended Services - Hosting, Payment and more ...
    Signup for our Announcements Forums to stay up to date on important changes and updates!

  10. #10
    Join Date
    Oct 2010
    Location
    Idaho
    Posts
    292
    Plugin Contributions
    0

    Default Re: Buy Now button consistency

    actually, yeah, I think that does clarify things. Thanks. One quick question (I've taken too much of your time on this):

    If doing this, to not pass the 'more info' link, when 'sold out' is the button getting displayed ... does that break/interfere with/stop the other functionality of 'more info' appearing on left, such as appearing on left when product has attributes?

    In other words, does what you described solely affect 'more info' when it would otherwise show up above 'sold out' button, or would 'more info' on left be pretty much removed in all circumstances when it would otherwise appear? (The only other circumstance I can think of is product w/ attributes but maybe there are other circumstances I'm not aware of.)

    I may go ahead with what you've described if it would not affect more-info-on-left in any other circumstances.

    Thanks, again.

 

 
Page 1 of 2 12 LastLast

Similar Threads

  1. v139h Changing BUY NOW button to SPONSOR NOW in one category
    By tomig in forum Templates, Stylesheets, Page Layout
    Replies: 7
    Last Post: 9 Sep 2015, 12:25 AM
  2. Change the Add to Cart button to Buy Now button
    By dastudio in forum Customization from the Admin
    Replies: 1
    Last Post: 24 Nov 2010, 09:44 PM
  3. Adding a more info button alongside buy now button
    By jwburnside in forum General Questions
    Replies: 5
    Last Post: 6 Nov 2010, 01:36 PM
  4. How do I replace the Buy Now button with an Add to Cart button?
    By OrcaSoul in forum Templates, Stylesheets, Page Layout
    Replies: 9
    Last Post: 19 Feb 2010, 05:36 AM
  5. Buy Now Button
    By jwburnside in forum Setting Up Categories, Products, Attributes
    Replies: 1
    Last Post: 21 Jul 2009, 11:04 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR