Page 4 of 5 FirstFirst ... 2345 LastLast
Results 31 to 40 of 49
  1. #31
    Join Date
    Jul 2012
    Posts
    16,734
    Plugin Contributions
    17

    Default Re: Support Thread: Checkbox Textbox Icon Addon for Listings

    Quote Originally Posted by linuxguy2 View Post
    Excellent! Changing true to 'true' in the modified template files fixed the add to cart issue.

    However the code you listed for the "shopping_cart classes doesn't exist in any of the code I have ever downloaded for ZC or the CBTB plugin. Yes, I always use "developers toolkit " to search.
    i.e.
    version "CheckBoxTextBoxIconV1.0.3" nor version "CheckBoxTextBoxIcon06V1.0.0"
    Am I missing something?

    Code:
            if ($multiAddCheck == true && (PRODUCT_ALL_CHECKBOX_TEXTBOX_ACTIVE == '1' || PRODUCT_FEATURED_CHECKBOX_TEXTBOX_ACTIVE == '1' || PRODUCT_NEW_CHECKBOX_TEXTBOX_ACTIVE == '1' || PRODUCT_LISTING_CHECKBOX_TEXTBOX_ACTIVE == '1')){
              //reset($_POST['products_id2']);
              
              foreach ($_POST['products_id2'] as $key2 => $val2) {
    That code segment is/was there, but the if statement was a little different having $multiAddCheck at the end of the logic instead of at the beginning. After some four years of additional ZC php coding experience it seemed that the logic should be modified a little to possibly bypass that section of code "faster". A similar developers tool kit search for $multiAddCheck should identify the section referenced above.
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  2. #32
    Join Date
    Sep 2013
    Location
    Texas
    Posts
    304
    Plugin Contributions
    0

    Default Re: Support Thread: Checkbox Textbox Icon Addon for Listings

    NOTE:
    A substantial amount of code has been added to ZC V15.5f shopping_cart classes.

    Yes, that logic is there but coded differently.
    It appears the "foreach" was intended to be implemented but never was.
    See comment: * @todo change while loop to a foreach

    Code:
    /**
       * Method to handle cart Action - multiple add products
       *
       * @param string forward destination
       * @param url parameters
       * @todo change while loop to a foreach
       */
      function actionMultipleAddProduct($goto, $parameters) {
        global $messageStack;
        $addCount = 0;
    
        if (is_array($_POST['products_id']) && sizeof($_POST['products_id']) > 0) {
    		// Begin mc12345678 Checkbox/TextBox
    	    if ($_POST['check_text_active'] == true) {
    		    $multiAddCheck = true;
    		} else {
    		    $multiAddCheck = false;
    		}
    		// End mc12345678 Checkbox/TextBox
    	    while ( list( $key, $val ) = each($_POST['products_id']) ) {
    
    		// Begin mc12345678 Checkbox/TextBox
    		    if ((PRODUCT_ALL_CHECKBOX_TEXTBOX_ACTIVE == '1' || PRODUCT_FEATURED_CHECKBOX_TEXTBOX_ACTIVE == '1' || PRODUCT_NEW_CHECKBOX_TEXTBOX_ACTIVE == '1' || PRODUCT_LISTING_CHECKBOX_TEXTBOX_ACTIVE == '1') && $multiAddCheck == true){
    			    //reset($_POST['products_id2']);
    			    
    			    while ( list( $key2, $val2 ) = each($_POST['products_id2']) ) {
    				 if ($key == $key2) {
    					 if ($val > 0) 
    				{

  3. #33
    Join Date
    Jul 2012
    Posts
    16,734
    Plugin Contributions
    17

    Default Re: Support Thread: Checkbox Textbox Icon Addon for Listings

    Quote Originally Posted by linuxguy2 View Post
    NOTE:
    A substantial amount of code has been added to ZC V15.5f shopping_cart classes.

    Yes, that logic is there but coded differently.
    It appears the "foreach" was intended to be implemented but never was.
    See comment: * @todo change while loop to a foreach

    Code:
    /**
       * Method to handle cart Action - multiple add products
       *
       * @param string forward destination
       * @param url parameters
       * @todo change while loop to a foreach
       */
      function actionMultipleAddProduct($goto, $parameters) {
        global $messageStack;
        $addCount = 0;
    
        if (is_array($_POST['products_id']) && sizeof($_POST['products_id']) > 0) {
            // Begin mc12345678 Checkbox/TextBox
            if ($_POST['check_text_active'] == true) {
                $multiAddCheck = true;
            } else {
                $multiAddCheck = false;
            }
            // End mc12345678 Checkbox/TextBox
            while ( list( $key, $val ) = each($_POST['products_id']) ) {
    
            // Begin mc12345678 Checkbox/TextBox
                if ((PRODUCT_ALL_CHECKBOX_TEXTBOX_ACTIVE == '1' || PRODUCT_FEATURED_CHECKBOX_TEXTBOX_ACTIVE == '1' || PRODUCT_NEW_CHECKBOX_TEXTBOX_ACTIVE == '1' || PRODUCT_LISTING_CHECKBOX_TEXTBOX_ACTIVE == '1') && $multiAddCheck == true){
                    //reset($_POST['products_id2']);
                    
                    while ( list( $key2, $val2 ) = each($_POST['products_id2']) ) {
                     if ($key == $key2) {
                         if ($val > 0) 
                    {
    Yes, I forgot that I made my portion of the code more 7.x compatible by removing the list() = each() style from the code added by this plugin. I believe 1.5.6 already has modified that area for its own loop.

    I may also further modify the logic of:
    Code:
    (PRODUCT_ALL_CHECKBOX_TEXTBOX_ACTIVE == '1' ||  PRODUCT_FEATURED_CHECKBOX_TEXTBOX_ACTIVE == '1' ||  PRODUCT_NEW_CHECKBOX_TEXTBOX_ACTIVE == '1' ||  PRODUCT_LISTING_CHECKBOX_TEXTBOX_ACTIVE == '1')
    to:
    Code:
    !(PRODUCT_ALL_CHECKBOX_TEXTBOX_ACTIVE != '1' &&  PRODUCT_FEATURED_CHECKBOX_TEXTBOX_ACTIVE != '1' &&  PRODUCT_NEW_CHECKBOX_TEXTBOX_ACTIVE != '1' &&  PRODUCT_LISTING_CHECKBOX_TEXTBOX_ACTIVE != '1')
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  4. #34
    Join Date
    Sep 2013
    Location
    Texas
    Posts
    304
    Plugin Contributions
    0

    Default Re: Support Thread: Checkbox Textbox Icon Addon for Listings

    Quote Originally Posted by mc12345678 View Post
    Ok, figured it out...

    Apparently, the ZC function zen_not_null now operates differently than it used to or did in my previous testing. I say this because in each of the modified template files, there is this "generic" code that is intended to create a hidden field. To correct the issue described above, change the Boolean true to a string 'true' as below.
    From:
    Code:
        if ((PRODUCT_ALL_LISTING_MULTIPLE_ADD_TO_CART > 0) && (PRODUCT_ALL_CHECKBOX_TEXTBOX_ACTIVE == true)) {
            echo zen_draw_hidden_field('check_text_active', true); 
        }
    Code:
        if ((PRODUCT_ALL_LISTING_MULTIPLE_ADD_TO_CART > 0) && (PRODUCT_ALL_CHECKBOX_TEXTBOX_ACTIVE == true)) {
            echo zen_draw_hidden_field('check_text_active', 'true'); 
        }
    by changing true to 'true' (don't modify other logic around it.

    Perhaps the easiest way to find the area(s) to modify would be to use the developers toolkit and search for:
    check_text_active


    Another correction I made in editing the code was in the shopping_cart class to bypass a foreach loop if there is nothing to process in the loop changing:
    Code:
            if ($multiAddCheck == true && (PRODUCT_ALL_CHECKBOX_TEXTBOX_ACTIVE == '1' || PRODUCT_FEATURED_CHECKBOX_TEXTBOX_ACTIVE == '1' || PRODUCT_NEW_CHECKBOX_TEXTBOX_ACTIVE == '1' || PRODUCT_LISTING_CHECKBOX_TEXTBOX_ACTIVE == '1')){
              //reset($_POST['products_id2']);
              
              foreach ($_POST['products_id2'] as $key2 => $val2) {
    to:

    Code:
            if ($multiAddCheck == true && (PRODUCT_ALL_CHECKBOX_TEXTBOX_ACTIVE == '1' || PRODUCT_FEATURED_CHECKBOX_TEXTBOX_ACTIVE == '1' || PRODUCT_NEW_CHECKBOX_TEXTBOX_ACTIVE == '1' || PRODUCT_LISTING_CHECKBOX_TEXTBOX_ACTIVE == '1')){
              //reset($_POST['products_id2']);
              
              if (!isset($_POST['products_id2'])) continue;
              
              foreach ($_POST['products_id2'] as $key2 => $val2) {
    I'll see about getting an update together for distribution. There are some minor code improvements, but the two changes made above corrected the overall issue(s) encountered.

    The three files tpl_modules_products_featured_listing.php, tpl_modules_products_new_listing.php and tpl_modules_products_featured_all.php also need the 'true' fix around line 26.

    Took a little head scratching but I did merge the CBT additions/changes with the latest ZC 1.5.5f shopping_cart.php and if you want it I can zip it up and email it to you.

  5. #35
    Join Date
    Jul 2012
    Posts
    16,734
    Plugin Contributions
    17

    Default Re: Support Thread: Checkbox Textbox Icon Addon for Listings

    Quote Originally Posted by linuxguy2 View Post
    The three files tpl_modules_products_featured_listing.php, tpl_modules_products_new_listing.php and tpl_modules_products_featured_all.php also need the 'true' fix around line 26.

    Took a little head scratching but I did merge the CBT additions/changes with the latest ZC 1.5.5f shopping_cart.php and if you want it I can zip it up and email it to you.
    Yeah, the other three files do/did need that. Certainly could send that over, worth comparing the end results and still might find a way to intrude on the software less...
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  6. #36
    Join Date
    Sep 2013
    Location
    Texas
    Posts
    304
    Plugin Contributions
    0

    Default Re: Support Thread: Checkbox Textbox Icon Addon for Listings

    Quote Originally Posted by mc12345678 View Post
    Yeah, the other three files do/did need that. Certainly could send that over, worth comparing the end results and still might find a way to intrude on the software less...
    Your mailbox is full. You can download the file from this link.
    I'm sure you can improve on this code.
    http://www.linuxguy2.com/ShoppingCart.html

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

    Default Re: Support Thread: Checkbox Textbox Icon Addon for Listings

    Quote Originally Posted by linuxguy2 View Post
    Your mailbox is full. You can download the file from this link.
    I'm sure you can improve on this code.
    http://www.linuxguy2.com/ShoppingCart.html
    Downloaded, thank you. Have a few other things I'm working on at the moment but still plan to update the plugin.
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  8. #38
    Join Date
    Sep 2013
    Location
    Texas
    Posts
    304
    Plugin Contributions
    0

    Default Re: Support Thread: Checkbox Textbox Icon Addon for Listings

    Out of box test installation:
    ZC 155f responsive_classic
    PHP 7.1
    Plugins:
    export_shipping_information_V1.3.4

    Unless I'm missing something in the configuration...
    When ordering product it appears to me you have to go to the "More Info..." link on the products pages to access the drop down or checkboxes (or other attributes) to make your selection.

    Also on the order form the product is listed once with the attributes noted below it.

    So the questions are:
    1:
    Could the attribute selection (sizes etc...) be listed on the product page.
    (In my case I want checkboxes)
    2:
    Could the orders screen/form have each product with attribute listed as a line item.
    +++++++++++++++

    On the "orders" screen instead of this:
    3 x 4400407
    - Size: S (+$15.00)
    - Size: L (+$18.00)
    +++++++++++++++

    This:
    3 x 4400407S .... $15.00 ...
    3 x 4400407L .... $18.00 ...

  9. #39
    Join Date
    Sep 2013
    Location
    Texas
    Posts
    304
    Plugin Contributions
    0

    Default Re: Support Thread: Checkbox Textbox Icon Addon for Listings

    PHP 7.1
    ZC 1.5.6

    I've tried several times but have been unable to merge the CheckBoxTextBoxIconV1.0.3 > /includes/classes/shopping_cart.php with the zen-cart-v1.5.6-12102018 > /includes/classes/shopping_cart.php without it crashing the system.
    The shopping_cart.php included in the CBTB plugin does work on it's own but there is a significant amount of code missing that's in the 1.5.6 shopping_cart.php script.
    That code was added for a reason and I'm concerned about failures down the road.

  10. #40
    Join Date
    Jul 2012
    Posts
    16,734
    Plugin Contributions
    17

    Default Re: Support Thread: Checkbox Textbox Icon Addon for Listings

    Will look into it, but am addressing some other software updates as well.
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

 

 
Page 4 of 5 FirstFirst ... 2345 LastLast

Similar Threads

  1. Zen Lightbox addon [Support Thread]
    By Alex Clarke in forum All Other Contributions/Addons
    Replies: 3720
    Last Post: 6 Oct 2022, 11:18 PM
  2. Free Shipping Rules addon [Support Thread]
    By numinix in forum Addon Shipping Modules
    Replies: 36
    Last Post: 2 Dec 2016, 01:56 PM
  3. v151 Reviews Reply addon [Support Thread]
    By mikestaps in forum All Other Contributions/Addons
    Replies: 9
    Last Post: 17 Oct 2014, 01:29 AM
  4. v151 Admin Master-Categories Link Icon addon [support thread]
    By gjh42 in forum All Other Contributions/Addons
    Replies: 1
    Last Post: 18 Oct 2012, 08:07 PM
  5. File Upload Required addon [Support Thread]
    By 1100101 in forum All Other Contributions/Addons
    Replies: 21
    Last Post: 10 Dec 2011, 03:00 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