Results 1 to 8 of 8
  1. #1
    Join Date
    Sep 2015
    Location
    Colorado
    Posts
    3
    Plugin Contributions
    0

    Default Changing BUY NOW button to SPONSOR NOW in one category

    Looking for guidance on changing out the BUY NOW button to a SPONSOR NOW button in one category only. The other four categories would remain the same with BUY NOW as we also sell products.

    The SPONSOR NOW button would do the same thing as BUY NOW. We are a non-profit and the SPONSOR NOW is for sponsoring children. BUY NOW isn't too good to use.

    Thank you in advance for your guidance.

  2. #2
    Join Date
    Aug 2005
    Location
    Arizona
    Posts
    27,761
    Plugin Contributions
    9

    Default Re: Changing BUY NOW button to SPONSOR NOW in one category

    This will require a bit of custom coding and relies upon all of them being in the same category
    Zen-Venom Get Bitten

  3. #3
    Join Date
    Dec 2009
    Location
    Amersfoort, The Netherlands
    Posts
    2,846
    Plugin Contributions
    25

    Default Re: Changing BUY NOW button to SPONSOR NOW in one category

    I haven't looked in to the details, but couldn't this be done by using a custom product_type? Giving this product type a sponsor button in stead of the regular buy button?

  4. #4
    Join Date
    Jul 2012
    Posts
    16,733
    Plugin Contributions
    17

    Default Re: Changing BUY NOW button to SPONSOR NOW in one category

    Haven't tried it yet, but what about using some form of css replacement of the image or overlay?

    Btw, if you are going a more purist route, there are some "internal" switches that would need to be modified as well... Look at the uri when clicking on a Buy Now button. Has action=buy_now... I would almost suggest simply finding a common ground term/phrase to be used throughout.

    No the button is not initially product type specific as the code for the button can be found in product_listing, all products, featured products, and new products. An indicator like a product type could be helpful as compared to a category because what if some non-child product were added to the category that is related to the children but not one to be "sponsored"...

    So, here's what I did to figure out where the code was to address this: I went to tools->developers tool kit. In the lower left corner I typed in 'buy now'. (No quotes) this brought up a define for: BUTTON_BUY_NOW_ALT (at least in ZC 1.5.4). This provided several files that could be altered to "filter" on the desired criteria in order to display the desired button (though still thinking that might be possible through CSS).
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  5. #5
    Join Date
    Sep 2015
    Location
    Colorado
    Posts
    3
    Plugin Contributions
    0

    Default Re: Changing BUY NOW button to SPONSOR NOW in one category

    Thank you all for the input and your time!

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

    Default Re: Changing BUY NOW button to SPONSOR NOW in one category

    You could customize the code in:
    /includes/modules/products_listing.php

    using your templates and overrides directory and change the code around line 134 to include the code in RED:
    Code:
    // qty box with add to cart button
                if (PRODUCT_LIST_PRICE_BUY_NOW == '2' && $listing->fields['products_qty_box_status'] != 0) {
                  $lc_button= zen_draw_form('cart_quantity', zen_href_link($_GET['main_page'], zen_get_all_get_params(array('action')) . 'action=add_product&products_id=' . $listing->fields['products_id']), 'post', 'enctype="multipart/form-data"') . '<input type="text" name="cart_quantity" value="' . (zen_get_buy_now_qty($listing->fields['products_id'])) . '" maxlength="6" size="4" /><br />' . zen_draw_hidden_field('products_id', $listing->fields['products_id']) . zen_image_submit(BUTTON_IMAGE_IN_CART, BUTTON_IN_CART_ALT) . '</form>';
                } else {
    // bof: special buy now button for master_categories_id 53
    if (zen_get_products_category_id($listing->fields['products_id']) == 53) {
                  $lc_button = '<a href="' . zen_href_link($_GET['main_page'], zen_get_all_get_params(array('action')) . 'action=buy_now&products_id=' . $listing->fields['products_id']) . '">' . zen_image_button('button_buy_now2.gif', BUTTON_BUY_NOW_ALT, 'class="listingBuyNowButton"') . '</a>';
    } else {
                  $lc_button = '<a href="' . zen_href_link($_GET['main_page'], zen_get_all_get_params(array('action')) . 'action=buy_now&products_id=' . $listing->fields['products_id']) . '">' . zen_image_button(BUTTON_IMAGE_BUY_NOW, BUTTON_BUY_NOW_ALT, 'class="listingBuyNowButton"') . '</a>';
    }
    // eof: special buy now button for master_categories_id 53
                }
              }
            }
            $the_button = $lc_button;
    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!

  7. #7
    Join Date
    Sep 2015
    Location
    Colorado
    Posts
    3
    Plugin Contributions
    0

    Default Re: Changing BUY NOW button to SPONSOR NOW in one category

    Thank you Ajeh!

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

    Default Re: Changing BUY NOW button to SPONSOR NOW in one category

    You are most welcome ...
    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!

 

 

Similar Threads

  1. v150 How Do I Make The "Buy Now" Button Go Away For Just One Item?
    By Scully in forum General Questions
    Replies: 5
    Last Post: 12 Feb 2013, 10:33 PM
  2. buy now button not on category page?
    By inestine in forum Setting Up Categories, Products, Attributes
    Replies: 11
    Last Post: 2 Sep 2010, 07:44 PM
  3. Add More Info Button after Buy Now on category listing
    By gothstone in forum General Questions
    Replies: 46
    Last Post: 22 Jan 2009, 09:52 PM
  4. One 'buy now' button - others all cart boxes?
    By orphanespresso in forum Templates, Stylesheets, Page Layout
    Replies: 1
    Last Post: 26 Dec 2007, 08:46 PM
  5. Buy now button when viewing category
    By TheSpunkyLobster in forum Customization from the Admin
    Replies: 10
    Last Post: 16 Oct 2006, 05:15 AM

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