Jump to content

discxpress

Members
  • Content count

    731
  • Joined

  • Last visited

  • Days Won

    6

Posts posted by discxpress


  1. On 3/19/2020 at 6:54 AM, ecartz said:
    
    <script>$(document).ready(function() { $('button[name="wishlist"]').bind('click', function() {
        let input = document.createElement('input');
    
        input.setAttribute('type', 'hidden');
        input.setAttribute('name', 'wishlist');
        input.setAttribute('value', 'wishlist');
    
        let form = $(this).closest('form');
        form.unbind('submit');
        form.append(input);
        form.submit();
    
        return false;
      });});
    </script>

     

    Yes this works! Thanks Matt @ecartz


  2. 10 minutes ago, ecartz said:

    The problem that LeeFoster identified was a conflict with another App.  If he turned off the header_tag module from the other App, he could get the Wishlist to work.  That App has a header_tag module. 

    The ideal would be to add this as its own header_tag module that adds to footer_scripts but for testing purposes, anything that adds to footer_scripts would probably work.  For testing purposes (to verify that it works), you could add it to template_bottom.  But that would put it on every page even though it's only needed on the product_info page. 

    When I added that script to template_bottom it didn't work. The same behavior. There's code in application_top: 

    // BOF WISHLIST
    // wishlist data
    	if (!tep_session_is_registered('wishList') || !is_object($wishList)) {
    		tep_session_register('wishList');
    		$wishList = new wishlist;
    	}
    	
    //Wishlist actions (must be before shopping cart actions)
      if (isset($_POST['wishlist'])) {
    	  if (isset($_POST['products_id']) && is_numeric($_POST['products_id'])) {
          $attributes = isset($_POST['id']) ? $_POST['id'] : '';
    
            // php 5
            $qty = isset($_POST['qty']) ? (int)$_POST['qty'] : 1;
            // php 7
            // $qty = (int)($_POST['qty'] ?? 1);
    
          $wishList->add_wishlist($_POST['products_id'], $wishList->get_quantity(tep_get_uprid($_POST['products_id'], $attributes))+$qty, $attributes);
    	  }
    		if (WISHLIST_REDIRECT ==  'No') tep_redirect(tep_href_link('product_info.php', 'products_id=' . $_POST['products_id']));
    	  tep_redirect(tep_href_link('wishlist.php'));
      }
    // EOF WISHLIST

    Then there's the class file in which does the work of the button. As @LeeFoster stated it works once the Ajax buttons is turned off. 


  3. 6 hours ago, ecartz said:
    
    <script>$(document).ready(function(){ $('button[name="wishlist"]').bind('click', function() {
        let input = document.createElement('input');
    
        input.setAttribute('type', 'hidden');
        input.setAttribute('name', 'wishlist');
        input.setAttribute('value', 'wishlist');
    
        let form = $(this).parents('form:first');
        form.appendChild(input);
        form.submit();
    
        return false;
      }});
    </script>

    I think that this would fix it. 

    To test it, you could add this into the existing header tag module with which you are having trouble, as that already adds scripts to the footer.  But you might then want to move it into its own module or hook after establishing that it works. 

    The problem is that the AJAX submission is not passing which button was clicked to submit the form.  Which makes sense because there is only one button in the default install.  So  if Javascript is running, this adds a form input to the form when that button is clicked. 

    Hmmm. You threw me off when you said add to existing header tag module. I believe this version doesn't have that. But I also have no need to doubt you because your level of code is light years beyond my understanding. So I'll place it around until I find the correct spot.

    Thanks for your help sir.


  4. From my understanding, all the work is done from this block of code

    // BOF WISHLIST
    // wishlist data
    	if (!tep_session_is_registered('wishList') || !is_object($wishList)) {
    		tep_session_register('wishList');
    		$wishList = new wishlist;
    	}
    	
    //Wishlist actions (must be before shopping cart actions)
      if (isset($_POST['wishlist'])) {
    	  if (isset($_POST['products_id']) && is_numeric($_POST['products_id'])) {
          $attributes = isset($_POST['id']) ? $_POST['id'] : '';
    
            // php 5
    //        $qty = isset($_POST['qty']) ? (int)$_POST['qty'] : 1;
            // php 7
             $qty = (int)($_POST['qty'] ?? 1);
    
          $wishList->add_wishlist($_POST['products_id'], $wishList->get_quantity(tep_get_uprid($_POST['products_id'], $attributes))+$qty, $attributes);
    	  }
    		if (WISHLIST_REDIRECT ==  'No') tep_redirect(tep_href_link('product_info.php', 'products_id=' . $_POST['products_id']));
    	  tep_redirect(tep_href_link('wishlist.php'));
      }
    // EOF WISHLIST

    @kgtee @ecartz my php version is 7.3


  5. 28 minutes ago, ecartz said:

    I'm pretty sure that this only happens in some browsers.  You may want to find out where @kgtee has this installed and check the behavior there. 

    Or post what browser you're using so people trying to debug can use the same one. 

    Same behavior in Firefox @ecartz


  6. 1 minute ago, ecartz said:

    I'm pretty sure that this only happens in some browsers.  You may want to find out where @kgtee has this installed and check the behavior there. 

    Or post what browser you're using so people trying to debug can use the same one. 

    I use latest version of Chrome.


  7. 5 hours ago, kgtee said:

    I have been using the wishlist addon on my heavily modified 1.0.1.3 without any issue. Today I tried to migrate it to 1.0.5.2 and there seems to be no problem. Anyone interested may try this version.

    Wishlist.zip

    I just installed your version. here's the errors:

    Stack trace:
    #0 /home/xxxxxxxxxx/public_html/includes/system/versioned/1.0.4.0/osc_template.php(147): cm_navbar->execute()
    #1 /home/xxxxxxxxxx/public_html/includes/template_top.php(58): oscTemplate->getContent('navigation')
    #2 /home/xxxxxxxxxx/public_html/index.php(35): require('/home/q4p7grzvy...')
    #3 {main}
      thrown in /home/xxxxxxxxxx/public_html/includes/modules/content/navigation/cm_navbar.php on line 58
    [18-Mar-2020 06:02:02 UTC] PHP Fatal error:  Uncaught Error: Class 'nb_wishlist' not found in /home/xxxxxxxxxx/public_html/includes/modules/content/navigation/cm_navbar.php:58
    Stack trace:
    #0 /home/xxxxxxxxxx/public_html/includes/system/versioned/1.0.4.0/osc_template.php(147): cm_navbar->execute()
    #1 /home/xxxxxxxxxx/public_html/includes/template_top.php(58): oscTemplate->getContent('navigation')
    #2 /home/xxxxxxxxxx/public_html/index.php(35): require('/home/q4p7grzvy...')
    #3 {main}
      thrown in /home/xxxxxxxxxx/public_html/includes/modules/content/navigation/cm_navbar.php on line 58

    Also note that when you click save to favorites, an item is added to shopping cart. Thanks


  8. @LeeFoster looking through error logs, it's something about

    $wishList->count_contents()

    that Phoenix doesn't like.

    Here's what my error logs report

    [17-Mar-2020 08:26:56 UTC] PHP Warning:  Use of undefined constant HEADER_ACCOUNT_WISHLIST - assumed 'HEADER_ACCOUNT_WISHLIST' (this will throw an Error in a future version of PHP) in /home/q4p7grzvy49t/public_html/includes/languages/english/modules/navbar/nb_wishlist.php on line 16
    [17-Mar-2020 08:26:56 UTC] PHP Fatal error:  Uncaught Error: Call to a member function count_contents() on null in /home/q4p7grzvy49t/public_html/includes/modules/navbar/templates/tpl_nb_wishlist.php:3
    Stack trace:
    #0 /home/q4p7grzvy49t/public_html/includes/modules/block_template.php(14): include()
    #1 /home/q4p7grzvy49t/public_html/includes/modules/navbar/nb_wishlist.php(51): include('/home/q4p7grzvy...')
    #2 /home/q4p7grzvy49t/public_html/includes/modules/content/navigation/cm_navbar.php(60): nb_wishlist->getOutput()
    #3 /home/q4p7grzvy49t/public_html/includes/system/versioned/1.0.4.0/osc_template.php(147): cm_navbar->execute()
    #4 /home/q4p7grzvy49t/public_html/includes/template_top.php(58): oscTemplate->getContent('navigation')
    #5 /home/q4p7grzvy49t/public_html/product_info.php(24): require('/home/q4p7grzvy...')
    #6 {main}
      thrown in /home/q4p7grzvy49t/public_html/includes/modules/navbar/templates/tpl_nb_wishlist.php on line 3

     


  9. 27 minutes ago, raiwa said:

    I just checked on my Phoenix 1.0.4.3 test store and all works as expected.

    Do you have the PWA Keep Account checkout success module installed. If yes, you are prompted to choose if you wish to keep account or not. You have to tick one option, otherwise the continue button will not forward.

    Yes I have PWA Keep Account module installed.

    When you have time check for yourself https://melophilemp3.com/account_pwa.php 

    Thankd for your time


  10. @Jack_mcs great addon from a legend.

    Maybe on a future update you can do this:

    1. customer enters website from search engine

    2. on the product page is a badge "X% off click here" displayed in clear view with your timer

    3. visitor click on badge and a box pops up 

    4. visitor enters email address and instant discount applied

    5. have an instant and future customer signed up for future offers. A great way to build email marketing list

    6. use a cookie to identify customer so the discount is one time

    An example is here. Let me know your thoughts


  11. 2 minutes ago, JcMagpie said:

    Talk to Stripe and see what they say, I checked with my payment provider and they say no cookies are loaded untill paymet option is selected and then it's required to use the service so you can not opt out. If you dont use the service no cookie is installed.

    I would imagin it's the same for Stripe why would they need to add cookies if payment by them is not selected?

    One for the payment system developers.

    Yes it's the same for Stripe

×