Results 1 to 10 of 10
  1. #1
    Join Date
    Jun 2007
    Location
    Texas, USA
    Posts
    1,393
    Plugin Contributions
    1

    bug If Customer has items in cart and Admin clicks on item to view... gets blank screen

    This one is easy guys.... I fixed it... you put it into code.... :) Customer has item in cart.... admin views "whos online" clicks customer with active cart.... clicks link .... gets blank area of admin screen.... fix takes to edit product... which I assume is what was supposed to happen. BTW... is there a list of "actions" that can be taken with different cmd's or screens? I kind of thought a action=display_product might have been desired too... but edit is fine except information spread out quite a bit.




    >admin > whos_online.php

    if ($cart !== null) {
    $contents[] = ['text' => $whos_online[$selectedSession]['full_name'] . ' - ' . $cart['customer_ip'] . ' (' . $cart['language_code'] . ')<br>' . $selectedSession];


    foreach ($cart['products'] as $product) {
    $contents[] = ['text' => $product['quantity'] . ' x ' . '<a href="' . zen_href_link(FILENAME_PRODUCT, 'cPath=' . zen_get_product_path($product['id']) . '&pID=' . $product['id']) . '">' . $product['name'] . '</a>'];
    }

    Change to:

    if ($cart !== null) {
    $contents[] = ['text' => $whos_online[$selectedSession]['full_name'] . ' - ' . $cart['customer_ip'] . ' (' . $cart['language_code'] . ')<br>' . $selectedSession];


    foreach ($cart['products'] as $product) {
    $contents[] = ['text' => $product['quantity'] . ' x ' . '<a href="' . zen_href_link(FILENAME_PRODUCT, 'cPath=' . zen_get_product_path($product['id']) . '&pID=' . $product['id']) . '&action=new_product' . '">' . $product['name'] . '</a>'];
    }

  2. #2
    Join Date
    Jan 2004
    Posts
    66,347
    Blog Entries
    7
    Plugin Contributions
    271

    Default Re: If Customer has items in cart and Admin clicks on item to view... gets blank scre

    When you click the link for the product, as the storeowner, were you hoping it would take you to the product on the storefront? or is (as your suggested code fix will do) taking you to the product's Edit screen more what you wanted?

    My point: maybe an even better fix is to link to the product on the storefront instead?
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  3. #3
    Join Date
    Jan 2004
    Posts
    66,347
    Blog Entries
    7
    Plugin Contributions
    271

    Default Re: If Customer has items in cart and Admin clicks on item to view... gets blank scre

    FYI: To put it back to how it worked before v1.5.7, which was to highlight the product within its category (instead of going into edit mode), the fix would be:

    Code:
    $contents[] = ['text' => $product['quantity'] . ' x ' . '<a href="' . zen_href_link(FILENAME_PRODUCT, 'cPath=' . zen_get_product_path($product['id']) . '&pID=' . $product['id']) . '">' . $product['name'] . '</a>'];
    

    becomes
    Code:
    $contents[] = ['text' => $product['quantity'] . ' x ' . '<a href="' . zen_href_link(FILENAME_CATEGORY_PRODUCT_LISTING, 'cPath=' . zen_get_product_path($product['id']) . '&pID=' . $product['id']) . '">' . $product['name'] . '</a>'];
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  4. #4
    Join Date
    Jan 2004
    Posts
    66,347
    Blog Entries
    7
    Plugin Contributions
    271

    Default Re: If Customer has items in cart and Admin clicks on item to view... gets blank scre

    Or to link it to the storefront page, that same line would become:

    Code:
                      $contents[] = ['text' => $product['quantity'] . ' x ' . '<a href="' . zen_catalog_href_link(zen_get_info_page($product['id']), 'cPath=' . zen_get_product_path($product['id']) . '&products_id=' . $product['id'] . '&language=' . $cart['language_code']) . '" target="_blank" rel="noreferrer noopener">' . $product['name'] . '</a>'];
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  5. #5
    Join Date
    Jun 2007
    Location
    Texas, USA
    Posts
    1,393
    Plugin Contributions
    1

    Default Re: If Customer has items in cart and Admin clicks on item to view... gets blank scre

    Quote Originally Posted by DrByte View Post
    When you click the link for the product, as the storeowner, were you hoping it would take you to the product on the storefront? or is (as your suggested code fix will do) taking you to the product's Edit screen more what you wanted?

    My point: maybe an even better fix is to link to the product on the storefront instead?
    That is exactly what I thought it was going to do.... but when I looked into the bones I was thinking you guys had something else in mind. I can see benefits to going to the edit .... you see somebody have something in their cart.... you know that it is sold out but hasn't been marked sold out yet and you can quickly change quantity.... but yes, I thought it was going to take me to a page to view the product.... the admin directory was listed and I have never seen the product viewed from there before .... thanks for checking!

  6. #6
    Join Date
    Jun 2007
    Location
    Texas, USA
    Posts
    1,393
    Plugin Contributions
    1

    Default Re: If Customer has items in cart and Admin clicks on item to view... gets blank scre

    Quote Originally Posted by DrByte View Post
    Or to link it to the storefront page, that same line would become:

    Code:
                      $contents[] = ['text' => $product['quantity'] . ' x ' . '<a href="' . zen_catalog_href_link(zen_get_info_page($product['id']), 'cPath=' . zen_get_product_path($product['id']) . '&products_id=' . $product['id'] . '&language=' . $cart['language_code']) . '" target="_blank" rel="noreferrer noopener">' . $product['name'] . '</a>'];
    hmmm, I tried the fix with FILENAME_CATEGORY_PRODUCT_LISTING I see 100 different items and do not know which the customer has in the cart. I would say either go to edit.... or to go the websites page.... if I were to vote I guess I would vote for edit with a link on the edit page to the website page!

  7. #7
    Join Date
    Feb 2006
    Location
    Tampa Bay, Florida
    Posts
    7,849
    Plugin Contributions
    108

    Default Re: If Customer has items in cart and Admin clicks on item to view... gets blank scre

    Quote Originally Posted by DrByte View Post
    FYI: To put it back to how it worked before v1.5.7, which was to highlight the product within its category (instead of going into edit mode), the fix would be:
    ...

    Quote Originally Posted by DrByte View Post
    Or to link it to the storefront page, that same line would become:
    ...
    That settles it - clearly what's needed here is an admin switch to pick the desired behavior. <ducks quickly>
    That Software Guy. My Store: Zen Cart Modifications
    Available for hire - See my ad in Services
    Plugin Moderator, Documentation Curator, Chief Cook and Bottle-Washer.

  8. #8
    Join Date
    Jul 2012
    Posts
    15,913
    Plugin Contributions
    17

    Default Re: If Customer has items in cart and Admin clicks on item to view... gets blank scre

    Quote Originally Posted by swguy View Post
    That settles it - clearly what's needed here is an admin switch to pick the desired behavior. <ducks quickly>
    Or multiple links for each product in the shopping cart where no additional configuration switches may be necessary. (e.g. Edit, catalog, category)
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  9. #9
    Join Date
    Jun 2007
    Location
    Texas, USA
    Posts
    1,393
    Plugin Contributions
    1

    Default Re: If Customer has items in cart and Admin clicks on item to view... gets blank scre

    Quote Originally Posted by mc12345678 View Post
    Or multiple links for each product in the shopping cart where no additional configuration switches may be necessary. (e.g. Edit, catalog, category)
    We need some polls here to help decide!

  10. #10
    Join Date
    Jan 2004
    Posts
    66,347
    Blog Entries
    7
    Plugin Contributions
    271

    Default Re: If Customer has items in cart and Admin clicks on item to view... gets blank scre

    To avoid switches, polls, confusion, give all options:
    Code:
    if (!defined('IMAGE_CATEGORY')) define('IMAGE_CATEGORY', 'Category');
                    foreach ($cart['products'] as $product) {
                      $contents[] = ['text' => $product['quantity'] . ' x '
                             . ' <a href="' . zen_catalog_href_link(zen_get_info_page($product['id']), 'cPath=' . zen_get_product_path($product['id']) . '&products_id=' . $product['id'] . '&language=' . $cart['language_code']) . '" target="_blank" rel="noreferrer noopener">'
                             . $product['name']
                             . '</a>'
                             . ' <a href="' . zen_href_link(FILENAME_PRODUCT, 'cPath=' . zen_get_product_path($product['id']) . '&pID=' . $product['id'] . '&action=new_product') . '" role="button" class="btn btn-sm btn-default"><i class="fa fa-pencil fa-lg" aria-hidden="true"></i> ' . IMAGE_EDIT . '</a>'
                             . ' <a href="' . zen_href_link(FILENAME_CATEGORY_PRODUCT_LISTING, 'cPath=' . zen_get_product_path($product['id']) . '&pID=' . $product['id']) . '" role="button" class="btn btn-sm btn-default"><i class="fa fa-list fa-lg" aria-hidden="true"></i> ' . IMAGE_CATEGORY . '</a>'
                            ];
                    }
    Name:  Screen Shot 2021-05-01 at 7.16.15 PM.jpg
Views: 94
Size:  43.1 KB
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

 

 

Similar Threads

  1. v154 Removing, weight and item count on shopping cart screen
    By resqjoc in forum General Questions
    Replies: 1
    Last Post: 29 Jan 2015, 12:20 AM
  2. v139h View Items in Customer's Shopping Cart
    By brewbrothers in forum Managing Customers and Orders
    Replies: 1
    Last Post: 19 Apr 2012, 02:17 AM
  3. when adding item to cart, screen goes blank
    By KurveMedia in forum Templates, Stylesheets, Page Layout
    Replies: 4
    Last Post: 20 Nov 2008, 01:34 AM
  4. Remove continue shopping screen and just leave view cart side box
    By Lokesh in forum Templates, Stylesheets, Page Layout
    Replies: 5
    Last Post: 24 Oct 2007, 11:08 AM
  5. Customer has download problem - please view and comment
    By jeffmic in forum General Questions
    Replies: 4
    Last Post: 8 Nov 2006, 07:29 AM

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