Results 1 to 3 of 3
  1. #1
    Join Date
    Apr 2007
    Location
    Ontario, Canada
    Posts
    1,731
    Plugin Contributions
    27

    image problem Twitch Product Image Link on Account History

    Twitch Product Image Link on Account History

    Display product images with link-back to product on order account history display. Alternate click to reorder (add to cart) link included.


    Admin > Configuration > Layout Settings


    ## SQL Update - Add new switch
    INSERT INTO configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) VALUES ('Show <b>Product Image Link</b> on Account History', 'SHOW_PRODUCT_IMAGELINK_ACCOUNT_HISTORY', 'Show', 'Hide = Stock Product Name Text (no image) <br/><br/> Tracer: SHOW_PRODUCT_IMAGELINK_ACCOUNT_HISTORY <br/><br/> Default => Show', '19', '224', 'zen_cfg_select_option(array(\'Show\', \'Hide\'), ', now());


    ## DELETE CODE
    # DELETE FROM configuration WHERE configuration_key in ('SHOW_PRODUCT_IMAGELINK_ACCOUNT_HISTORY');
    ## DELETE CODE



    includes/templates/YOUR_TEMPLATE/templates/tpl_account_history_info_default.php

    replace this:
    echo $order->products[$i]['name'];


    with this:
    // Twitch Base7 for 1.57c
    if (SHOW_PRODUCT_IMAGELINK_ACCOUNT_HISTORY == 'Show') {
    $reorder_image = zen_get_products_image($order->products[$i]['id'], IMAGE_SHOPPING_CART_WIDTH, IMAGE_SHOPPING_CART_HEIGHT); // Twitch Fast Image Lookup

    // Add to cart (click to reorder)
    // Twitch hide - echo '<a href="' . zen_href_link($_GET['main_page'], zen_get_all_get_params(array('action')) . 'action=cust_order&pid=' . $order->products[$i]['id']) . '">'.$reorder_image. $order->products[$i]['name'] .'</a></li><br>' . "\n" ;

    // Show product link
    echo '<a href="' . zen_href_link(zen_get_info_page($order->products[$i]['id']), 'products_id=' . $order->products[$i]['id']) . '">' . $reorder_image.'&nbsp;'.$order->products[$i]['name'] . '</a>';
    } else { // stock
    echo $order->products[$i]['name'];
    }


    Tracer: Twitch Base7


    Your coffee donations are appreciated
    Twitch.
    https://www.twitchtoo.com Do you work for free? Please donate.
    Twitch Base8 - Obsidian - This, is what's new.

  2. #2
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    12,500
    Plugin Contributions
    88

    Default Re: Twitch Product Image Link on Account History

    Nice idea, but what happens if the purchased product is no longer available?

  3. #3
    Join Date
    Apr 2007
    Location
    Ontario, Canada
    Posts
    1,731
    Plugin Contributions
    27

    Idea or Suggestion Twitch Product Image Link on Account History - Twitch Base7 Commercial

    With my first post the cart follows normal stock rules about things missing:

    Sorry the product was not found.
    [Continue]

    You could customize the message/page if you feel your customers need more options.


    Or


    You could use the Twitch Base7 Commercial version:

    ### Twitch Product Image Link on Account History

    ## SQL Update - Add new switches
    INSERT INTO configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) VALUES ('Show <b>Product Image Link</b> on Account History', 'SHOW_PRODUCT_IMAGELINK_ACCOUNT_HISTORY', 'Show', 'Hide = Stock Product Name Text (no image) <br/><br/> Link will only show if product stock > 1 or product status = ON <br/>Tracer: SHOW_PRODUCT_IMAGELINK_ACCOUNT_HISTORY <br/><br/> Default => Show', '19', '224', 'zen_cfg_select_option(array(\'Show\', \'Hide\'), ', now());

    INSERT INTO configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) VALUES ('Show <b>Product Image Link</b> on Account History - Link Type', 'IMAGELINK_ACCOUNT_HISTORY_LINK_TYPE', 'Image', '<b>Image</b> = Display link to product <br/> <b/>Reorder</b> = Display as add to cart link <br/><br/> Default => Image', '19', '226', 'zen_cfg_select_option(array(\'Image\', \'Reorder\'), ', now());


    ## DELETE CODE
    # DELETE FROM configuration WHERE configuration_key in ('SHOW_PRODUCT_IMAGELINK_ACCOUNT_HISTORY');
    # DELETE FROM configuration WHERE configuration_key in ('IMAGELINK_ACCOUNT_HISTORY_LINK_TYPE');
    ## DELETE CODE



    includes/templates/YOUR_TEMPLATE/templates/tpl_account_history_info_default.php

    replace this:
    echo $order->products[$i]['name'];

    with this:
    // Twitch Base7 for 1.57c - Commercial
    if (SHOW_PRODUCT_IMAGELINK_ACCOUNT_HISTORY == 'Show') {
    // get product image
    $reorder_image = zen_get_products_image($order->products[$i]['id'], IMAGE_SHOPPING_CART_WIDTH, IMAGE_SHOPPING_CART_HEIGHT); // Twitch Fast Image Lookup
    // Get the status of a product
    $get_prod_status = "SELECT products_status from " . TABLE_PRODUCTS . (zen_not_null($order->products[$i]['id']) ? " WHERE products_id=" . (int)$order->products[$i]['id'] : "");
    $found_status = $db->Execute($get_prod_status);
    $found_status->fields['products_status'];

    if (zen_get_products_stock($order->products[$i]['id']) < 1 || $found_status->fields['products_status'] < 1) {
    // do not show link to unavailable product
    echo $reorder_image.'&nbsp;'.$order->products[$i]['name'];

    } else { // product in stock

    if (IMAGELINK_ACCOUNT_HISTORY_LINK_TYPE == 'Reorder') { // Add to cart (click to reorder)
    echo '<a href="' . zen_href_link($_GET['main_page'], zen_get_all_get_params(array('action')) . 'action=cust_order&pid=' . $order->products[$i]['id']) . '">'.$reorder_image. $order->products[$i]['name'] .'</a></li><br>' . "\n" ;
    } else { // Show product image, name and link (default)
    echo '<a href="' . zen_href_link(zen_get_info_page($order->products[$i]['id']), 'products_id=' . $order->products[$i]['id']) . '">' . $reorder_image.'&nbsp;'.$order->products[$i]['name'] . '</a>'; } }

    } else { // stock
    echo $order->products[$i]['name'];
    }


    Now the link will only show if product stock > 1 or product status = ON
    Twitch.
    https://www.twitchtoo.com Do you work for free? Please donate.
    Twitch Base8 - Obsidian - This, is what's new.

 

 

Similar Threads

  1. v157 Twitch Block Email Domains on Create Account
    By twitchtoo in forum Addon Admin Tools
    Replies: 1
    Last Post: 11 Mar 2022, 06:55 PM
  2. v151 Twitch Product Image Magnifier
    By twitchtoo in forum All Other Contributions/Addons
    Replies: 1
    Last Post: 8 Mar 2014, 02:29 AM
  3. v150 Print CSS only for customer account and account history page?
    By tips007 in forum General Questions
    Replies: 1
    Last Post: 3 Nov 2012, 03:53 AM
  4. how could it appears the product image in both client's account and my admin account?
    By bluesky2008 in forum Templates, Stylesheets, Page Layout
    Replies: 5
    Last Post: 31 Jul 2008, 07:45 PM
  5. No Order History info or My Account Page link
    By jdcjim in forum Basic Configuration
    Replies: 0
    Last Post: 3 Jun 2008, 11:32 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