Thread: Wishlist

Results 1 to 10 of 378

Hybrid View

  1. #1
    Join Date
    Nov 2006
    Posts
    512
    Plugin Contributions
    0

    Default Re: Wishlist

    I am using JenRed's code (thank you!) from above (no sidebox) is there some sort of "if" statement that can be added in order for "add to wishlist" to not display if out of stock? (I must delete out of stock items after a week, so they disappear off wishlist too)

    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;
                
    ?>

    <br clear=all><br><center>
    <?php 
    // (un): start wishlist link
    if ( $_SESSION['customer_id'] ) {
    echo 
    '<a href="' zen_href_link(UN_FILENAME_WISHLISTzen_get_all_get_params(array('action''products_id')) . 'products_id='.(int)$_GET['products_id'].'&action=un_add_wishlist') . '">' UN_TEXT_ADD_WISHLIST '</a>'
    } else {

    $_SESSION['navigation']->set_snapshot();
    echo 
    'please <a href=http://WWW.YOURSITE.COM/index.php?main_page=login>log in</a><br />to add this to<br />your Wish List'
    }
    // (un): end wishlist link
    ?>
    </center>

     </div>
      <?php // display qty and button ?>
    <?php 
    // CUSTOMERS_APPROVAL == 3 ?>
    <!--eof Add to Cart Box-->
    ps. Thank You tcustomgolf for the button nav code!

  2. #2
    Join Date
    Jan 2007
    Posts
    48
    Plugin Contributions
    0

    Default Re: Wishlist

    Hi all, Ive just installed this mod and im getting this error:

    1146 Table 'fishkrib_zc1.un_wishlists' doesn't exist
    in:
    [SELECT id FROM un_wishlists w WHERE w.customers_id=1 and w.default_status=1 ]

    Someone mentions it early in this thread but fixes it and doesnt say how, says something about renaming in myphpadmin, so i went to myphpadmin and renamed the tables but still comes up with the same error message.
    Any ideas?

    And in my admin it comes up with this message:

    1146 Table 'fishkrib_zc1.un_wishlists' doesn't exist
    in:
    [SELECT w.id, w.customers_id, w.created, w.modified, w.name, w.comment, w.default_status, w.public_status, count(p.products_id) as items_count, c.customers_email_address, c.customers_firstname, c.customers_lastname FROM un_wishlists w LEFT JOIN un_products_to_wishlists p2w ON w.id=p2w.un_wishlists_id LEFT JOIN zen_products p ON p2w.products_id=p.products_id LEFT JOIN zen_customers c ON w.customers_id=c.customers_id GROUP BY w.id ]
    If you were entering information, press the BACK button in your browser and re-check the information you had entered to be sure you left no blank fields.
    Last edited by troy77; 15 Feb 2007 at 06:36 PM. Reason: needed to add something

  3. #3
    Join Date
    Dec 2005
    Location
    NY
    Posts
    188
    Plugin Contributions
    0

    Default Re: Wishlist

    Troy...the sql statement that gets loaded from the wishlist mod files does not include a table prefix, so when it is loaded, it loads without the prefix. To fix, you either have to modify the sql statement and include your table prefix and reload, or go into myphpadmin to modify the table as discussed.

    The prefix on all my tables is zen_ You can determine yours in myphpadmin, but zencart tables I believe default to this. Add that before any table statement like CREATE TABLE `un_wishlists`. So this will become CREATE TABLE `zen_un_wishlists` in the sql statement, then reload the statement in your zen admin.

    myphpadmin is accessed through your hosting cos. cPanel or similar hosting site admin program, and you can modify the table names there also.

    If you need help with either, feel free to PM me with a number to call...

  4. #4
    Join Date
    Jan 2007
    Posts
    48
    Plugin Contributions
    0

    Default Re: Wishlist

    A big thank you for that "tcustomgolf" but it now doesnt ad anything to the wishlist and is there a way i can have it as a button in the description instead of a sidebox if i can ever get it to work

  5. #5
    Join Date
    Dec 2005
    Location
    NY
    Posts
    188
    Plugin Contributions
    0

    Default Re: Wishlist

    Coding isn't my thing, but if you look at JenRed's post above, it could give you some ideas.

    The wishlist doc also goes into create a wishlist link. If you look at my site in a product screen, I have a link right under the price, and one in the add to cart box below. I implemented JenRed's code in both and both will show "Add to Wish List" when logged in (very slick). If you do not log in, it will show as you are probably seeing it on my site, asking you to log in to add to the wish list.

    I think there are also some posts dealing with adding a button, and I think in the wishlist doc.

    Not sure why it is not adding anything...

  6. #6
    Join Date
    Jan 2007
    Posts
    48
    Plugin Contributions
    0

    Default Re: Wishlist

    Thanks for your help, ive managed to get it running with 1 or 2 small problems, i wont double post so here my problems:

    http://www.zen-cart.com/forum/showth...406#post330406


    Thanks again for your help

  7. #7
    Join Date
    Nov 2006
    Posts
    512
    Plugin Contributions
    0

    Default Re: Wishlist

    Kenobi!

    DO you have IH2?

    Check this Thread: http://www.zen-cart.com/forum/showthread.php?t=38564

    Oh and I made some progress on this: having the wishlist mod box/link not display when item is out of stock:

    maybe if I add something like this:

    PHP Code:
    if ($_SESSION['cart']->count_contents() <= 0) { 
    to this:

    PHP Code:
    $display false;
    if ( isset(
    $_GET['products_id']) && zen_products_id_valid($_GET['products_id']) ) {
        if ( !
    preg_match('/^un_wishlist/',$_GET['main_page']) ) { 
    But am unsure how to discribe in php such a statement in ZC php:

    ????? ['un_wislist]->quantity() <= 0) { ???????

    Has anybody done this before?

    Quote Originally Posted by dharma View Post
    I am using JenRed's code (thank you!) from above (no sidebox) is there some sort of "if" statement that can be added in order for "add to wishlist" to not display if out of stock? (I must delete out of stock items after a week, so they disappear off wishlist too)

    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;
                
    ?>

    <br clear=all><br><center>
    <?php 
    // (un): start wishlist link
    if ( $_SESSION['customer_id'] ) {
    echo 
    '<a href="' zen_href_link(UN_FILENAME_WISHLISTzen_get_all_get_params(array('action''products_id')) . 'products_id='.(int)$_GET['products_id'].'&action=un_add_wishlist') . '">' UN_TEXT_ADD_WISHLIST '</a>'
    } else {

    $_SESSION['navigation']->set_snapshot();
    echo 
    'please <a href=http://WWW.YOURSITE.COM/index.php?main_page=login>log in</a><br />to add this to<br />your Wish List'
    }
    // (un): end wishlist link
    ?>
    </center>

     </div>
      <?php // display qty and button ?>
    <?php 
    // CUSTOMERS_APPROVAL == 3 ?>
    <!--eof Add to Cart Box-->
    ps. Thank You tcustomgolf for the button nav code!
    Last edited by dharma; 17 Feb 2007 at 10:19 PM. Reason: Too Much Coffee

  8. #8
    Join Date
    Nov 2006
    Posts
    512
    Plugin Contributions
    0

    Default Re: Wishlist

    Whoops! the code would go in JenRed's contribution:

    PHP Code:

    // (un): start wishlist link
    if ( $_SESSION['customer_id'] ) {
    echo 
    '<a href="' zen_href_link(UN_FILENAME_WISHLISTzen_get_all_get_params(array('action''products_id')) . 'products_id='.(int)$_GET['products_id'].'&action=un_add_wishlist') . '">' UN_TEXT_ADD_WISHLIST '</a>'
    } else {

    $_SESSION['navigation']->set_snapshot();
    echo 
    'please <a href=http://WWW.YOURSITE.COM/index.php?main_page=login>log in</a><br />to add this to<br />your Wish List'
    }
    // (un): end wishlist link 

  9. #9
    Join Date
    Nov 2006
    Posts
    512
    Plugin Contributions
    0

    Default Re: Wishlist

    This is an IF statement added to JenRed's code that will make the wishlist mod link only appear when the product is IN of stock....
    PHP Code:
    <?php
    // (un): start wishlist link
     
    if (zen_get_products_stock($_GET['products_id']) != 0)  {
    if ( 
    $_SESSION['customer_id'] ) {
    echo 
    '<a href="' zen_href_link(UN_FILENAME_WISHLIST,
    zen_get_all_get_params(array('action''products_id')) .
    'products_id='.(int)$_GET['products_id'].'&action=un_add_wishlist') .
    '">' UN_TEXT_ADD_WISHLIST '</a>';
    } else {

    $_SESSION['navigation']->set_snapshot();
    echo 
    'please <a
    href=https://YOUR_SITE/index.php?main_page=login>log
    in</a><br />to add this to<br />your Wish List'
    ;
    }
    // (un): end wishlist link
    }
    ?>

 

 

Similar Threads

  1. v151 Wishlist
    By Kevin205 in forum General Questions
    Replies: 0
    Last Post: 15 Jan 2013, 01:45 AM
  2. Wishlist
    By simplemedia in forum All Other Contributions/Addons
    Replies: 3
    Last Post: 20 Apr 2012, 08:40 PM
  3. Wishlist 0.9
    By vinnyna in forum All Other Contributions/Addons
    Replies: 0
    Last Post: 23 Nov 2011, 03:52 PM
  4. 1.5.0 wishlist?
    By trickobrien in forum Upgrading to 1.5.x
    Replies: 2
    Last Post: 21 Oct 2011, 07:16 PM
  5. Wishlist
    By Dutchman in forum All Other Contributions/Addons
    Replies: 0
    Last Post: 3 Oct 2007, 02:37 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