Results 1 to 10 of 10

Hybrid View

  1. #1
    Join Date
    Feb 2009
    Posts
    32
    Plugin Contributions
    0

    help question How do I change the buy button into a text link?

    Hi,

    I'm trying to change the look of my "add to cart" button. Instead of an image, I want it to be a simple text link.
    But so far, no luck...

    How do I change the zen_image_submit(BUTTON_IMAGE_IN_CART, BUTTON_IN_CART_ALT) part with a regular <a href></a> link?

    PHP Code:

    <!--bof Add to Cart Box -->
    <?php
    if (CUSTOMERS_APPROVAL == and TEXT_LOGIN_FOR_PRICE_BUTTON_REPLACE_SHOWROOM == '') {
      
    // do nothing
    } else {
    ?>
                <?php
        $display_qty 
    = (($flag_show_product_info_in_cart_qty == and $_SESSION['cart']->in_cart($_GET['products_id'])) ? '<p>' PRODUCTS_ORDER_QTY_TEXT_IN_CART $_SESSION['cart']->get_quantity($_GET['products_id']) . '</p>' '');
                if (
    $products_qty_box_status == or $products_quantity_order_max== 1) {
                  
    // hide the quantity box and default to 1
                  
    $the_button '<input type="hidden" name="cart_quantity" value="1" />' zen_draw_hidden_field('products_id', (int)$_GET['products_id']) . zen_image_submit(BUTTON_IMAGE_IN_CARTBUTTON_IN_CART_ALT);
                } else {
                  
    // show the quantity box
        
    $the_button PRODUCTS_ORDER_QTY_TEXT '<input type="text" name="cart_quantity" value="' . (zen_get_buy_now_qty($_GET['products_id'])) . '" maxlength="6" size="4" /><br />' zen_get_products_quantity_min_units_display((int)$_GET['products_id']) . '<br />' zen_draw_hidden_field('products_id', (int)$_GET['products_id']) . zen_image_submit(BUTTON_IMAGE_IN_CARTBUTTON_IN_CART_ALT);
                }
        
    $display_button zen_get_buy_now_button($_GET['products_id'], $the_button);
      
    ?>
      <?php if ($display_qty != '' or $display_button != '') { ?>
        <div id="cartAdd">
        <?php
          
    echo $display_qty;
          echo 
    $display_button;
                
    ?>
              </div>
      <?php // display qty and button ?>
    <?php 
    // CUSTOMERS_APPROVAL == 3 ?>
    <!--eof Add to Cart Box-->

  2. #2
    Join Date
    Jan 2009
    Posts
    2,123
    Plugin Contributions
    0

    Default Re: How do I change the buy button into a text link?

    Start with the file that generates the buttons in the first place...

    /includes/languages/english/button_names.php

    Edit that file and remove the button_buy_now.gif text from between the apostrophes... DON'T remove the apostrophes.

    That way, the button wont display, but the define('BUTTON_BUY_NOW_ALT', 'Buy Now');

    text in between those apostrophes will display instead.

  3. #3
    Join Date
    Feb 2009
    Posts
    32
    Plugin Contributions
    0

    Default Re: How do I change the buy button into a text link?

    Thanx for your help!!! Unfortunately that doesn't work... It does get rid of the image button, but the alt text doesn't become a text link...

    In FF, it does appear as text, but doesn't listen to any css.

    In IE, it appears in a box with that red cross icon saying a picture file is missing.

    In Safari, you just get the question mark icon, also saying the picture file is missing...

    Any other way?

  4. #4
    Join Date
    Jan 2009
    Posts
    2,123
    Plugin Contributions
    0

    Default Re: How do I change the buy button into a text link?

    Hmmm, ok try this:

    replace;
    $the_button = '<input type="hidden" name="cart_quantity" value="1" />' . zen_draw_hidden_field('products_id', (int)$_GET['products_id']) . zen_image_submit(BUTTON_IMAGE_IN_CART, BUTTON_IN_CART_ALT);

    with;
    $the_button = '<input type="hidden" name="cart_quantity" value="1" />' . zen_draw_hidden_field('products_id', (int)$_GET['products_id']) . zen_image_submit(BUTTON_IN_CART_ALT);

  5. #5
    Join Date
    Feb 2009
    Posts
    32
    Plugin Contributions
    0

    Default Re: How do I change the buy button into a text link?

    That didn't do the trick either, sorry.

    In FF, I get nothing displayed
    In IE, I just get the red cross icon
    In Safari, I still get the question mark icon

  6. #6
    Join Date
    Jan 2009
    Posts
    2,123
    Plugin Contributions
    0

    Default Re: How do I change the buy button into a text link?

    In that case, my best solution would be to open the button image in Photoshop and redesign the actual button to something like this:

    http://www.limelites.co.uk/button_add_selected_text.gif

    There's probably another way to just change it to a text link, but my php just aint that good yet :-(

 

 

Similar Threads

  1. v150 How to change 'Contact Us' into plain text (not a link) in showcase mode?
    By scott_ease in forum Templates, Stylesheets, Page Layout
    Replies: 5
    Last Post: 1 Jul 2012, 10:15 PM
  2. How do I change my [Buy Now] button link?
    By perrydesigns in forum Setting Up Categories, Products, Attributes
    Replies: 0
    Last Post: 15 Feb 2011, 09:47 PM
  3. 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
  4. How do I change the Buy Now to a Radio Button
    By RobVox in forum Templates, Stylesheets, Page Layout
    Replies: 5
    Last Post: 15 Jun 2007, 08:54 PM
  5. Turn text link into button
    By vatel in forum Templates, Stylesheets, Page Layout
    Replies: 0
    Last Post: 14 May 2007, 11:03 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