Results 1 to 10 of 10

Hybrid View

  1. #1
    Join Date
    Aug 2005
    Location
    SF Bay Area, California, USA
    Posts
    89
    Plugin Contributions
    0

    Default Product Notification In Product Info Page?

    Picking up from the now-archived thread:
    http://www.zen-cart.com/forum/showthread.php?t=34691

    I asked if the Product Notifications sidebox content could be copied into an available table cell on the Product Info page (v 1.2.7 and lower)...

    Ajeh, in your last reply, you said:
    "Get the code from when the sidebox is set to NO ... then write a cute little IF to controll it ... :)"

    By this, do you mean I should use the code from both tpl_no_notifications.php and tpl_yes_notifications.php and add the IF, or use only the tpl_no_notifications.php code with an IF?

    I have only written very rudimentary IFs to this point, so this ought to be interesting! :)

    chrx

  2. #2
    Join Date
    Aug 2005
    Location
    SF Bay Area, California, USA
    Posts
    89
    Plugin Contributions
    0

    Re: Product Notification In Product Info Page?

    Bump for some further suggestions?

    Thanks,
    chrx

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

    Default Re: Product Notification In Product Info Page?

    That is correct ...

    You are making the code work like the sidebox but in the middle of your product _info page ...

    So, more or less you need the yes and no portions to accomplish this from the two parts ...

    This can be controlled with an IF statement just like the sidebox does 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!

  4. #4
    Join Date
    Aug 2005
    Location
    SF Bay Area, California, USA
    Posts
    89
    Plugin Contributions
    0

    Default Re: Product Notification In Product Info Page?

    Thanks for throwing me some more clues, Ajeh!

    I'm a little closer, and thought I'd run some of my discovery process by you (I hope this sin't too much info all at once)...

    My first step was to test the YES and NO first, before adding the IF to see if it functions outside the sidebox environment:

    I dropped both the "Notify Me" and "Don't Notify Me" lines from tpl_no_notifications.php and tpl_yes_notifications.php respectively (line 23 in both cases) and both buttons show up together on the page in all cases. The "Notify Me" adds the product to my notification list and the "Don't Notify Me" removes it, just like it is supposed to work (I assume) so it appears the Notify functionality is comfortable outside the sidebox so far. Again, regardless of the current status of the notification, both buttons show up; this because I "forced" them to display by surrounding them in <?php echo ?> functions.

    This is how it looks in the my_template/templates/tpl_product_info_display.php file at this point:

    ---------- begin testing code ----------
    <td align="left" colspan="1">

    <!-- FROM NO_NOTIFICATIONS -->
    <?php echo '<div class="sideBoxContents" align="center"><a href="' . zen_href_link($_GET['main_page'], zen_get_all_get_params(array('action')) . 'action=notify', $request_type) . '">' . zen_image(DIR_WS_TEMPLATE_IMAGES . OTHER_IMAGE_BOX_NOTIFY_YES, OTHER_BOX_NOTIFY_YES_ALT) . '</a><br /><a href="' . zen_href_link($_GET['main_page'], zen_get_all_get_params(array('action')) . 'action=notify', $request_type) . '">' . sprintf(BOX_NOTIFICATIONS_NOTIFY, zen_get_products_name($_GET['products_id'])) .'</a></div>'; ?>

    <!-- FROM YES_NOTIFICATIONS -->
    <?php echo '<div class="sideBoxContents" align="center"><a href="' . zen_href_link($_GET['main_page'], zen_get_all_get_params(array('action')) . 'action=notify_remove', $request_type) . '">' . zen_image(DIR_WS_TEMPLATE_IMAGES . OTHER_IMAGE_BOX_NOTIFY_REMOVE, OTHER_BOX_NOTIFY_REMOVE_ALT) . '<br />' . sprintf(BOX_NOTIFICATIONS_NOTIFY_REMOVE, zen_get_products_name($_GET['products_id'])) .'</a></div>'; ?>

    </td>
    ---------- end testing code ----------

    So next, based on my understanding of your response, I'll need to remove the <?php echo ?> functions I added here, then add the IF statement from /includes/modules/sideboxes/product_notifications.php

    I assume I'll also need to add the $content = ""; from line 22 of tpl_yes_notifications.php and tpl_no_notifications.php to the YES and NO lines here as well, so it appears like this before I add the IF:

    ---------- begin testing code ----------
    <td align="left" colspan="1">

    <!-- FROM NO_NOTIFICATIONS -->
    $content = "";
    $content .= '<div class="sideBoxContents" align="left"><a href="' . zen_href_link($_GET['main_page'], zen_get_all_get_params(array('action')) . 'action=notify', $request_type) . '">' . zen_image(DIR_WS_TEMPLATE_IMAGES . OTHER_IMAGE_BOX_NOTIFY_YES, OTHER_BOX_NOTIFY_YES_ALT) . '</a><br /><a href="' . zen_href_link($_GET['main_page'], zen_get_all_get_params(array('action')) . 'action=notify', $request_type) . '">' . sprintf(BOX_NOTIFICATIONS_NOTIFY, zen_get_products_name($_GET['products_id'])) .'</a></div>'; ?>

    <!-- FROM YES_NOTIFICATIONS -->
    $content = "";
    $content .= '<div class="sideBoxContents" align="left"><a href="' . zen_href_link($_GET['main_page'], zen_get_all_get_params(array('action')) . 'action=notify_remove', $request_type) . '">' . zen_image(DIR_WS_TEMPLATE_IMAGES . OTHER_IMAGE_BOX_NOTIFY_REMOVE, OTHER_BOX_NOTIFY_REMOVE_ALT) . '<br />' . sprintf(BOX_NOTIFICATIONS_NOTIFY_REMOVE, zen_get_products_name($_GET['products_id'])) .'</a></div>'; ?>

    </td>
    ---------- end testing code ----------

    This is my first attempt at a move like this, so I'm trying to track down everything I need to piece this together.

    Thanks again,
    chrx
    Last edited by chrx; 16 May 2006 at 05:46 PM.

  5. #5
    Join Date
    Aug 2005
    Location
    SF Bay Area, California, USA
    Posts
    89
    Plugin Contributions
    0

    Idea or Suggestion Re: Product Notification In Product Info Page!

    Finally figured it all out.

    First:
    The files involved for this (my) version of the Product Notifications transplant into the Product Info page include:

    /includes/modules/sideboxes/product_notifications.php

    /templates/template_default/common/tpl_box_default_single.php

    /includes/templates/my_template/templates/tpl_product_info_display.php

    /includes/templates/my_template/tpl_no_notifications.php

    /includes/templates/my_template/tpl_yes_notifications.php


    How it went together and code snippets to follow later!

    Cheers,
    chrx

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

    Default Re: Product Notification In Product Info Page?

    Thanks for the update chrx ... looking forward to seeing what you have done ...
    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. Replies: 0
    Last Post: 21 Mar 2012, 09:20 PM
  2. Issues with Product info page: my product image is overlapping the product name, etc
    By wmorris in forum Templates, Stylesheets, Page Layout
    Replies: 5
    Last Post: 4 May 2011, 06:30 PM
  3. remove View or change my product notification list from account info page
    By Sushigal in forum Templates, Stylesheets, Page Layout
    Replies: 1
    Last Post: 19 May 2010, 04:54 PM
  4. Replies: 0
    Last Post: 18 Dec 2009, 01:07 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