Results 1 to 2 of 2
  1. #1
    Join Date
    Oct 2008
    Location
    Croatia
    Posts
    1,542
    Plugin Contributions
    19

    Default [Done v160] admin coupons pagination and selecting a coupon

    This was reported to me several times before, but I never paid much attention to it...

    On Discount Coupons admin page, I have 59 active coupons (displayed 20 per page) and 7 inactive coupons.

    Click image for larger version. 

Name:	coupons1.jpg 
Views:	86 
Size:	36.2 KB 
ID:	16518

    Some coupons are OK, but SOME simply reset and take me to the next page, with NO coupon selected.
    Inspect element shows the following link: xxxxxx/coupon_admin.php?page=1&cid=29
    When I click on that row, it just takes me to another coupons page, with no coupon selected on the right. URL is correct.

    Click image for larger version. 

Name:	coupons2.jpg 
Views:	86 
Size:	36.7 KB 
ID:	16519

    The one thing that confuses me most is that it doesn't happen with all coupons on Page 1, there are a few that work. If I change the number of coupons per page to a higher value and get all coupons on one page, it's all good.

    I made a simple change in admin/coupon_admin.php on line 996:
    Code:
    if (($_GET['page'] == '' or $_GET['page'] == '1') and $_GET['cid'] != '') {
    changed to
    Code:
    if ($_GET['page'] == '' and $_GET['cid'] != '') {
    and the problems were gone, everything worked fine.

    My questions:
    1) is this really a fix or will it cause different problems?
    2) comment above that line says "reset page when page is unknown" - why do we reset it if it's page 1 (URL parameter is page=1)?

    Thanks!

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

    Default Re: [Done v160] admin coupons pagination and selecting a coupon

    Should be harmless.

    I'm mindful that v1.6.0 has removed that segment of the code. I haven't investigated whether simply removing that whole block might be okay in v155 as well.
    .

    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. Replies: 1
    Last Post: 25 Jul 2016, 03:04 PM
  2. Coupon Admin disappeared from GC / Coupons menu
    By Diego Vieira in forum General Questions
    Replies: 2
    Last Post: 3 May 2009, 02:03 AM
  3. Replies: 0
    Last Post: 7 Feb 2008, 11:39 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