Results 1 to 10 of 10
  1. #1

    Default Getting but now button to show up and function in sidebox

    Greetings folks,
    I created a add to cart button in my specials sidebox on the the right right under best sellers sidebox.

    My site: www.cooltechcentral.com

    I can't get it to function, I was wondering if someone could help with getting the button to work better yet getting the buy it now button to show up and work instead.
    Last edited by ctcentralinfo; 29 Aug 2008 at 11:43 PM.
    Rich People scream, Wealthy people whisper

    www.cooltechcentral.com

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

    Default Re: Getting but now button to show up and function in sidebox

    This is some code that was for Featured Products to get buttons or add to cart with quantity box ... and had the built in safety to attributes to be more info ...

    PHP Code:
        if (zen_has_product_attributes($featured_products->fields['products_id'])) {
          
    // show a more link for attributes
          
    $lc_button '<a href="' zen_href_link(zen_get_info_page($featured_products->fields['products_id']), 'cPath=' . ( ($_GET['manufacturers_id'] > and $_GET['filter_id']) > zen_get_generated_category_path_rev($_GET['filter_id']) : $_GET['cPath'] > zen_get_generated_category_path_rev($_GET['cPath']) : zen_get_generated_category_path_rev($listing->fields['master_categories_id'])) . '&products_id=' $featured_products->fields['products_id']) . '">' MORE_INFO_TEXT '</a>';
          
    $lc_button2 '<a href="' zen_href_link(zen_get_info_page($featured_products->fields['products_id']), 'cPath=' . ( ($_GET['manufacturers_id'] > and $_GET['filter_id']) > zen_get_generated_category_path_rev($_GET['filter_id']) : $_GET['cPath'] > zen_get_generated_category_path_rev($_GET['cPath']) : zen_get_generated_category_path_rev($listing->fields['master_categories_id'])) . '&products_id=' $featured_products->fields['products_id']) . '">' MORE_INFO_TEXT '</a>';
        } else {
          
    // show an add to cart choose one or the other
          
    $lc_button '<a href="' zen_href_link($_GET['main_page'], zen_get_all_get_params(array('action')) . 'action=buy_now&products_id=' $featured_products->fields['products_id']) . '">' zen_image_button(BUTTON_IMAGE_BUY_NOWBUTTON_BUY_NOW_ALT'class="listingBuyNowButton"') . '</a>';
          
    $lc_button2zen_draw_form('cart_quantity'zen_href_link(zen_get_info_page($featured_products->fields['products_id']), zen_get_all_get_params(array('action')) . 'action=add_product&products_id=' $featured_products->fields['products_id']), 'post''enctype="multipart/form-data"') . '<input type="text" name="cart_quantity" value="' . (zen_get_buy_now_qty($featured_products->fields['products_id'])) . '" maxlength="6" size="4" /><br />' zen_draw_hidden_field('products_id'$featured_products->fields['products_id']) . zen_image_submit(BUTTON_IMAGE_IN_CARTBUTTON_IN_CART_ALT) . '</form>';
        } 
    echo $lc_button or echo $lc_button2 will show the results once you have the variables and such set for the specials ...

    See if any of that helps get you on the right track ...
    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!]
    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!

  3. #3

    Default Re: Getting but now button to show up and function in sidebox

    I used both, but I get

    which each time generates:

    Sorry, the product was not found.
    instead of

    Rich People scream, Wealthy people whisper

    www.cooltechcentral.com

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

    Default Re: Getting but now button to show up and function in sidebox

    You need to look in the immediate code that you are in and see how the variables/arrays are referenced ...

    If the products_id is often $products_id ... you might need:
    $featured_products->fields['products_id']

    as in the example I gave ...

    But, you are in specials ... so it probably will be different ...

    Code examples just need a little bit of adapting for use in other places or other files ...
    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!]
    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!

  5. #5

    Default Re: Getting but now button to show up and function in sidebox

    I am not sure what you mean, This is what I did:

    $content .= '<div>' . $lc_button = '<a href="' . zen_href_link($_GET['main_page'], zen_get_all_get_params(array('action')) . 'action=buy_now&products_id=' . $specials_products->fields['products_id']) . '">' . zen_image_button(BUTTON_IMAGE_BUY_NOW, BUTTON_BUY_NOW_ALT, 'class="listingBuyNowButton"') . '</div>';
    I am not sure what you mean.
    Rich People scream, Wealthy people whisper

    www.cooltechcentral.com

  6. #6
    Join Date
    Jul 2005
    Location
    Upstate NY
    Posts
    22,010
    Plugin Contributions
    25

    Default Re: Getting but now button to show up and function in sidebox

    PHP Code:
    $content .= '<div>' $lc_button '<a href="' zen_href_link($_GET['main_page'], zen_get_all_get_params(array('action')) . 'action=buy_now&products_id=' $specials_products->fields['products_id']) . '">' zen_image_button(BUTTON_IMAGE_BUY_NOWBUTTON_BUY_NOW_ALT'class="listingBuyNowButton"') . '</div>'
    For starters, pasting the whole $lc_button = ... statement into the middle of the $content assembly won't work.
    You need to let $lc_button be built and then add it to the $content.
    PHP Code:
    $lc_button '<a href="' zen_href_link($_GET['main_page'], zen_get_all_get_params(array('action')) . 'action=buy_now&products_id=' $specials_products->fields['products_id']) . '">' zen_image_button(BUTTON_IMAGE_BUY_NOWBUTTON_BUY_NOW_ALT'class="listingBuyNowButton"')
    $content .= '<div>' $lc_button '</div>'
    Actually, you probably want the whole snippet posted by Ajeh above, followed by

    $content .= '<div>' . $lc_button . '</div>';

    and you might need to alter some of the code as she described.

  7. #7

    Default Re: Getting but now button to show up and function in sidebox

    I tried using both lines of code:

    $content .= '<div>' . $lc_button = '<a href="' . zen_href_link($_GET['main_page'], zen_get_all_get_params(array('action')) . 'action=buy_now&products_id=' . $specials_products->fields['products_id']) . '">' . zen_image_button(BUTTON_IMAGE_BUY_NOW, BUTTON_BUY_NOW_ALT, 'class="listingBuyNowButton"') . '</div>';


    $content .= '<div>' . $lc_button2= zen_draw_form('cart_quantity', zen_href_link(zen_get_info_page($specials_products->fields['products_id']), zen_get_all_get_params(array('action')) . 'action=add_product&products_id=' . $specials_products->fields['products_id']), 'post', 'enctype="multipart/form-data"') . '<input type="text" name="cart_quantity" value="' . (zen_get_buy_now_qty($specials_products->fields['products_id'])) . '" maxlength="6" size="4" /><br />' . zen_draw_hidden_field('products_id', $specials_products->fields['products_id']) . zen_image_submit(BUTTON_IMAGE_IN_CART, BUTTON_IN_CART_ALT) . '</div>';
    but I get the same error message
    Rich People scream, Wealthy people whisper

    www.cooltechcentral.com

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

    Default Re: Getting but now button to show up and function in sidebox

    Try this and stick $lc_button where you want the buy now button to appear:
    PHP Code:
        if (zen_has_product_attributes($random_specials_sidebox_product->fields['products_id'])) {
          
    // show a more link for attributes
          
    $lc_button '<a href="' zen_href_link(zen_get_info_page($random_specials_sidebox_product->fields['products_id']), 'cPath=' zen_get_generated_category_path_rev($random_specials_sidebox_product->fields['master_categories_id']) . '&products_id=' $random_specials_sidebox_product->fields['products_id']) . '">' MORE_INFO_TEXT '</a>';
        } else {
          
    // show an add to cart choose one or the other
          
    $lc_button '<a href="' zen_href_link($_GET['main_page'], zen_get_all_get_params(array('action')) . 'action=buy_now&products_id=' $random_specials_sidebox_product->fields['products_id']) . '">' zen_image_button(BUTTON_IMAGE_BUY_NOWBUTTON_BUY_NOW_ALT'class="listingBuyNowButton"') . '</a>';
        } 
    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!]
    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!

  9. #9

    Default Re: Getting but now button to show up and function in sidebox

    That did the trick, thanks.
    Rich People scream, Wealthy people whisper

    www.cooltechcentral.com

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

    Default Re: Getting but now button to show up and function in sidebox

    Thanks for the update ...

    I thought the original code I posted could help you peice together the parts you needed, but it can get a little confusing at first ...

    Glad that you have it working now ...
    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!]
    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. v155 Missing Show All Button And Show Page View Button
    By Saintsteven in forum Templates, Stylesheets, Page Layout
    Replies: 10
    Last Post: 24 Mar 2016, 07:50 PM
  2. Show quanitity box and buy now button?
    By commdiver in forum Basic Configuration
    Replies: 7
    Last Post: 3 Jan 2011, 04:16 AM
  3. Replies: 3
    Last Post: 3 Sep 2010, 03:11 PM
  4. Site moved, now sidebox and footer don't show on main page
    By aesthetics in forum General Questions
    Replies: 3
    Last Post: 4 Nov 2009, 11:59 PM
  5. Replies: 3
    Last Post: 7 May 2009, 08:09 PM

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