Results 1 to 3 of 3
  1. #1
    Join Date
    Aug 2005
    Posts
    336
    Plugin Contributions
    0

    Default Easy PHP syntax question -- help please?

    This has been broken for months and it's really annoying people! I can't figure it out, but anyone with decent PHP skills can really help me out. If you have a moment, I'd really appreciate some advice.

    We are using a modified wishlist system, and on the product info page it works perfectly. When clicking on the wishlist button, a popup window lets you select which wishlist to add the product to. This code is here:
    On the product info page:
    Code:
    <!--bof ADD wishlist button-->
        <div id="infoListButton">
    <?php echo '<a href="' . zen_href_link(UN_FILENAME_WISHLIST, zen_get_all_get_params(array('action')) . 'action=un_add_wishlist') . '" onclick="clickAddWL(); return false;">' . zen_image_submit(BUTTON_IMAGE_ADD_WISHLIST, BUTTON_ADD_WISHLIST_ALT) . '</a><div class="wlListMenu" id="wlLists">&nbsp;</div>'; ?>
        </div>
    <!--eof ADD wishlist button-->
    BUT, on the product listing page, I can't figure out how to get the popup to work because the syntax is different. So, when you click on it, it adds to wishlist but the customer is taken to the wishlist page. This is really annoying because in our shop the product listing page is used almost entirely -- and it makes shopping take much longer when constantly going to the wishlist page.

    Can someone help me alter the following code to add the popup select window to the wishlist button?

    Here's the code on the product listing page:
    Code:
    // BEGIN Add wishlist button
            $lc_button2 = '';
            $lc_button2 = '<a href="' . zen_href_link(UN_FILENAME_WISHLIST, 'products_id=' . $listing->fields['products_id'] . '&action=un_add_wishlist') . '">' . zen_image_button(BUTTON_IMAGE_ADD_WISHLIST, BUTTON_ADD_WISHLIST_ALT, 'class="listingBuyNowButton"') . '</a>';
            $the_button2 = $lc_button2;
            $products_link = '';
            $lc_text .= zen_get_buy_now_button($listing->fields['products_id'], $the_button2, $products_link) . '<br />' . zen_get_products_quantity_min_units_display($listing->fields['products_id']);
    Currently using ZEN CART v. 1.3.6

  2. #2
    Join Date
    Aug 2005
    Posts
    336
    Plugin Contributions
    0

    Default Re: Easy PHP syntax question -- help please?

    I will happily pay someone to help me with this. Please, any advice or direction? Or send me a private message.
    Currently using ZEN CART v. 1.3.6

  3. #3
    Join Date
    Apr 2006
    Location
    London, UK
    Posts
    10,569
    Plugin Contributions
    25

    Default Re: Easy PHP syntax question -- help please?

    Hi magicpants

    No promises on this, more of a pointer really ...

    ... but from the snippets you've included, I suspect that the pop up is kicked of by the following bit of javascript
    onclick="clickAddWL(); return false;
    You might try therefore
    PHP Code:
    // BEGIN Add wishlist button
            
    $lc_button2 '';
            
    $lc_button2 '<a href="' zen_href_link(UN_FILENAME_WISHLIST'products_id=' $listing->fields['products_id'] . '&action=un_add_wishlist') . '" onclick="clickAddWL(); return false;">' zen_image_button(BUTTON_IMAGE_ADD_WISHLISTBUTTON_ADD_WISHLIST_ALT'class="listingBuyNowButton"') . '</a>';
            
    $the_button2 $lc_button2;
            
    $products_link '';
            
    $lc_text .= zen_get_buy_now_button($listing->fields['products_id'], $the_button2$products_link) . '<br />' zen_get_products_quantity_min_units_display($listing->fields['products_id']); 
    But what I can't see from this snippet, is how that javascript is included into you wishlist system and whether it is already included on your product listing page. If not you would need to copy the file that includes it into the modules/pages/ directory for the page listing where you wanted to use it.
    Kuroi Web Design and Development | Twitter

    (Questions answered in the forum only - so that any forum member can benefit - not by personal message)

 

 

Similar Threads

  1. Help with PHP syntax please?
    By sunflowertami in forum Templates, Stylesheets, Page Layout
    Replies: 2
    Last Post: 17 Jun 2008, 11:48 AM
  2. Replies: 3
    Last Post: 7 Apr 2008, 05:44 PM
  3. A simple .php code question? Please help!
    By triplemoonranch in forum Templates, Stylesheets, Page Layout
    Replies: 6
    Last Post: 24 Feb 2008, 01:55 AM
  4. Please help! php syntax needed to call images!
    By Vood in forum General Questions
    Replies: 3
    Last Post: 31 Oct 2007, 09:59 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