Page 1 of 2 12 LastLast
Results 1 to 10 of 12
  1. #1
    Join Date
    Dec 2018
    Location
    CT
    Posts
    6
    Plugin Contributions
    0

    Default admin product button functionality issue

    Since upgrading to 1.5.6 I'm having issues with admin product buttons functionality...ONLY for products beyond page 1 of category pages. Delete, move and copy functions don't work. Clicking the button reveals the respective window, but the product is not referenced (only "ID#" text is displayed with no product title or actual ID number, and no category reference), and for example with Delete Product, clicking Delete brings me back to page 1 of the category, and the product is not deleted.

    I've tested with php 7.1, 7.2 and 5.6 with no luck. I also removed URI Mappings Module which I thought might have been conflicting.

    My workaround was to increase max categories products display list to force all products to 1 page, but I'd like to find the real fix if anyone has any ideas?? Thanks.

  2. #2
    Join Date
    Jan 2004
    Posts
    66,373
    Blog Entries
    7
    Plugin Contributions
    274

    Default Re: admin product button functionality issue

    Does making the change shown here solve the problem you're experiencing?
    https://github.com/zencart/zencart/pull/1902/files
    .

    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
    Dec 2018
    Location
    CT
    Posts
    6
    Plugin Contributions
    0

    Default Re: admin product button functionality issue

    Thanks for the suggestion, but that edit didn't have any effect.

  4. #4
    Join Date
    Jan 2004
    Posts
    66,373
    Blog Entries
    7
    Plugin Contributions
    274

    Default Re: admin product button functionality issue

    You mentioned a plugin.
    Are there others installed too?
    In what ways are your admin PHP files different from original Zen Cart files?
    .

    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
    Dec 2007
    Location
    Payson, AZ
    Posts
    1,076
    Plugin Contributions
    15

    Default Re: admin product button functionality issue

    Testing with standard products I get the same response, copy, move, delete well not work on any page other then page 1!
    Following error message is logged.
    Code:
    [30-Dec-2018 22:36:53 Europe/Berlin] Request URI: /public_html/zen156/ADMIN/category_product_listing.php?cPath=5&product_type=1&pID=62&action=copy_product, IP address: 127.0.0.1
    #1  require(/public_html/zen156/ADMIN/includes/modules/copy_product.php) called at [public_html/zen156/ADMIN/category_product_listing.php:1088]
    [30-Dec-2018 22:36:53 Europe/Berlin] PHP Warning:  Creating default object from empty value in /public_html/zen156/ADMIN/includes/modules/copy_product.php on line 23
    Both vanilla and modified zc156, php7.2.14... whats strange is my product type auction is working just fine on page 2 with delete, copy, move! Which leads me to think something to do with the database sql... looking at the database, the product table is created with blink info,product description entry is not created... tracing product ID is empty on pages other then one... if I force the product ID with
    Code:
    $pID = $_GET['pID'];
    in copy_product.php the product is copied..

    Still looking for the rabbit, well follow up when I find it..
    Dave
    Always forward thinking... Lost my mind!

  6. #6
    Join Date
    Dec 2007
    Location
    Payson, AZ
    Posts
    1,076
    Plugin Contributions
    15

    Default Re: admin product button functionality issue

    Found it...
    Delete, move and copy links are not forwarding page number which then defaults to page 1 which leaves $pInfo empty. adding the page number to the link resolves the problem.

    admin/category_product_listing.php starting around line 899 added bit in red
    Code:
                          <a href="<?php echo zen_href_link(FILENAME_CATEGORY_PRODUCT_LISTING, 'cPath=' . $cPath . '&product_type=' . $product['products_type'] . '&pID=' . $product['products_id'] . '&action=delete_product' . (isset($_GET['page']) ? '&page=' . $_GET['page'] : '')); ?>" style="text-decoration: none">
                            <div class="fa-stack fa-lg delete">
                              <i class="fa fa-circle fa-stack-2x base"></i>
                              <i class="fa fa-trash-o fa-stack-1x overlay" aria-hidden="true"></i>
                            </div>
                            <?php // echo zen_image(DIR_WS_IMAGES . 'icon_delete.gif', ICON_DELETE); ?>
                          </a>
                          <a href="<?php echo zen_href_link(FILENAME_CATEGORY_PRODUCT_LISTING, 'cPath=' . $cPath . '&product_type=' . $product['products_type'] . '&pID=' . $product['products_id'] . '&action=move_product' . (isset($_GET['page']) ? '&page=' . $_GET['page'] : '')); ?>" style="text-decoration: none">
                            <div class="fa-stack fa-lg move">
                              <i class="fa fa-circle fa-stack-2x base"></i>
                              <i class="fa fa-stack-1x overlay" aria-hidden="true"><strong>M</strong></i>
                            </div>
                            <?php // echo zen_image(DIR_WS_IMAGES . 'icon_move.gif', ICON_MOVE); ?>
                          </a>
                          <a href="<?php echo zen_href_link(FILENAME_CATEGORY_PRODUCT_LISTING, 'cPath=' . $cPath . '&product_type=' . $product['products_type'] . '&pID=' . $product['products_id'] . '&action=copy_product' . (isset($_GET['page']) ? '&page=' . $_GET['page'] : '')); ?>" style="text-decoration: none">
                            <div class="fa-stack fa-lg copy">
                              <i class="fa fa-circle fa-stack-2x base"></i>
                              <i class="fa fa-stack-1x overlay" aria-hidden="true"><strong>C</strong></i>
                            </div>
                            <?php // echo zen_image(DIR_WS_IMAGES . 'icon_copy_to.gif', ICON_COPY_TO); ?>
                          </a>
    Dave
    Always forward thinking... Lost my mind!

  7. #7
    Join Date
    Jul 2012
    Posts
    16,733
    Plugin Contributions
    17

    Default Re: admin product button functionality issue

    Quote Originally Posted by davewest View Post
    Found it...
    Delete, move and copy links are not forwarding page number which then defaults to page 1 which leaves $pInfo empty. adding the page number to the link resolves the problem.

    admin/category_product_listing.php starting around line 899 added bit in red
    Code:
                          <a href="<?php echo zen_href_link(FILENAME_CATEGORY_PRODUCT_LISTING, 'cPath=' . $cPath . '&product_type=' . $product['products_type'] . '&pID=' . $product['products_id'] . '&action=delete_product' . (isset($_GET['page']) ? '&page=' . $_GET['page'] : '')); ?>" style="text-decoration: none">
                            <div class="fa-stack fa-lg delete">
                              <i class="fa fa-circle fa-stack-2x base"></i>
                              <i class="fa fa-trash-o fa-stack-1x overlay" aria-hidden="true"></i>
                            </div>
                            <?php // echo zen_image(DIR_WS_IMAGES . 'icon_delete.gif', ICON_DELETE); ?>
                          </a>
                          <a href="<?php echo zen_href_link(FILENAME_CATEGORY_PRODUCT_LISTING, 'cPath=' . $cPath . '&product_type=' . $product['products_type'] . '&pID=' . $product['products_id'] . '&action=move_product' . (isset($_GET['page']) ? '&page=' . $_GET['page'] : '')); ?>" style="text-decoration: none">
                            <div class="fa-stack fa-lg move">
                              <i class="fa fa-circle fa-stack-2x base"></i>
                              <i class="fa fa-stack-1x overlay" aria-hidden="true"><strong>M</strong></i>
                            </div>
                            <?php // echo zen_image(DIR_WS_IMAGES . 'icon_move.gif', ICON_MOVE); ?>
                          </a>
                          <a href="<?php echo zen_href_link(FILENAME_CATEGORY_PRODUCT_LISTING, 'cPath=' . $cPath . '&product_type=' . $product['products_type'] . '&pID=' . $product['products_id'] . '&action=copy_product' . (isset($_GET['page']) ? '&page=' . $_GET['page'] : '')); ?>" style="text-decoration: none">
                            <div class="fa-stack fa-lg copy">
                              <i class="fa fa-circle fa-stack-2x base"></i>
                              <i class="fa fa-stack-1x overlay" aria-hidden="true"><strong>C</strong></i>
                            </div>
                            <?php // echo zen_image(DIR_WS_IMAGES . 'icon_copy_to.gif', ICON_COPY_TO); ?>
                          </a>
    That seemed to resolve the absence of information on the "right" box.

    Came across something similar as an issue in testing the above solution. If a product has attributes and the A option has been selected, and the product has a download file, then the report about the status of that file is different from what is provided in the attributes controller. Ie: using the default store product at the following url the downloads 1 files invalid is identified, but go on to the attributes controller and everything is fine. Same if go to the downloads manager that all is identified fine (green dot).
    admin/category_product_listing.php?cPath=22&pID=22&action=attribute_features&page=3
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  8. #8
    Join Date
    Jul 2012
    Posts
    16,733
    Plugin Contributions
    17

    Default Re: admin product button functionality issue

    Quote Originally Posted by mc12345678 View Post
    That seemed to resolve the absence of information on the "right" box.

    Came across something similar as an issue in testing the above solution. If a product has attributes and the A option has been selected, and the product has a download file, then the report about the status of that file is different from what is provided in the attributes controller. Ie: using the default store product at the following url the downloads 1 files invalid is identified, but go on to the attributes controller and everything is fine. Same if go to the downloads manager that all is identified fine (green dot).
    admin/category_product_listing.php?cPath=22&pID=22&action=attribute_features&page=3
    Figured it out, the admin/includes/functions/general.php file for function, has an incorect logic.

    It looks like line 2545 should be changed from:
    Code:
    if (!file_exists(zen_get_download_handler($download_display->fields['products_attributes_filename']))) {
    To:
    Code:
    if (!zen_orders_products_downloads($download_display->fields['products_attributes_filename'])) {
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  9. #9
    Join Date
    Dec 2007
    Location
    Payson, AZ
    Posts
    1,076
    Plugin Contributions
    15

    Default Re: admin product button functionality issue

    Quote Originally Posted by mc12345678 View Post
    Figured it out, the admin/includes/functions/general.php file for function, has an incorect logic.

    It looks like line 2545 should be changed from:
    Code:
    if (!file_exists(zen_get_download_handler($download_display->fields['products_attributes_filename']))) {
    To:
    Code:
    if (!zen_orders_products_downloads($download_display->fields['products_attributes_filename'])) {
    Its the little things that get us... Thanks, didn't see that one.
    Dave
    Always forward thinking... Lost my mind!

  10. #10
    Join Date
    Jan 2004
    Posts
    66,373
    Blog Entries
    7
    Plugin Contributions
    274

    Default Re: admin product button functionality issue

    .

    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.

 

 
Page 1 of 2 12 LastLast

Similar Threads

  1. v150 Disable and enable product in admin not working? (red button or green button)
    By spiggles87 in forum Customization from the Admin
    Replies: 8
    Last Post: 26 Apr 2013, 10:39 PM
  2. v139h adding new button and functionality on my site
    By kizmark in forum Templates, Stylesheets, Page Layout
    Replies: 2
    Last Post: 23 Aug 2012, 09:41 PM
  3. Help Center Live Sidebox Functionality Issue
    By ScriptJunkie in forum Addon Sideboxes
    Replies: 3
    Last Post: 13 Sep 2008, 08:27 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