PLEASE NOTE: These forums are no longer utilized and are provided as an archive for informational purposes only. All support issues will be handled via email using our support ticket system. For more detailed information on this change, please see this blog post.

Problem with cart66 shorcodes in gravity forms html block

  1. Hello:
    I have created a form to show different payment options and using conditional html blocks to make the different payment options appear; the second and third work fine as they use Paypal buttons; but the first one is using a cart66 shortcode and the button does not work...
    I know the shorcode works because if I use it outside of the form on the page it works; but as soon as I put it in the html block it no longer works. I am using latest version of wordpress, gravity forms and also cart66; the version of thesis theme is 1.8...

    here is the page:

    http://charismaarts.com/la-conversation-camp-details-and-signup

    Can you help with this?

    Thanks!

    Gerard

    Posted 6 years ago on Monday January 9, 2012 | Permalink
  2. Well I have done some further testing on this to eliminate one possibility; I do not have the latest version of the "thesis" theme on the page I showed you; so I went to another site which had latest version of thesis (1.82); so it had everything as latest version and the exact same thing happens; basically you try and click on the "add to cart" button (which is placed there by the shortcode in the html block); nothing happens...

    thanks,

    Gerard

    Posted 6 years ago on Wednesday January 11, 2012 | Permalink
  3. Looks like the shortcode is being processed by Gravity Forms, and the Cart66 button appears. It's just not working to add to cart. I see this in the source:

    [js]
    /* <![CDATA[ */
    
    (function($){
        $(document).ready(function(){
        $('.Cart66AjaxWarning').hide();
        $('#addToCart_73').click(function() {
          $('#task_73').val('ajax');
                            $('#task_73').val('addToCart');
              $('#cartButtonForm_73').submit();
              return false;
                        return false;
        });
      })
    })(jQuery);
    
    /* ]] & g t ; */

    I added some spaces to the closing & gt ; so it would render. That problem with the end of the CDATA block can cause the script to not work and that might be what's going on here.

    Try embedding the cart66 shortcode in the page, not the form, then look at the source and compare the script block with the CDATA. If the closing part is correct, then that is what is preventing things from working.

    Here is a recent discussion of it. I'm not sure if we know what's causing this yet.

    Recent discussion of the closing of the CDATA block:
    http://www.gravityhelp.com/forums/topic/form-has-stopped-displaying-being-set-to-displaynone#post-43873

    Specifically:
    http://www.gravityhelp.com/forums/topic/xhtml-validation-gf_apply_rules#post-43168

    Posted 6 years ago on Wednesday January 11, 2012 | Permalink
  4. Hello Chris:

    Thanks for getting back with me on this. I am a beginning web programmer so I am a little out of my depth on this. But I have tried to do what you suggested, and I think I have an answer although it may not do any good. I put the add to cart button on another page that has latest version of everything. That page is: http://dantena.com/test
    It has the button on the page and then right below a form with the button in an html block; and the upper button works and the one in the form does not. I have "viewed source" on the page and looked at the code for each one and they look identical, except that the first button has like "task_1" and the second one has "task_1_2" which I am thinking is OK...
    Now there is no spacing in the closing of the CDATA; but it is that way on both; and so it seems that could not be the problem...I will paste in the source from each (page button first and form button second) so you can see:

    /* <![CDATA[ */

    (function($){
    $(document).ready(function(){
    $('.Cart66AjaxWarning').hide();
    $('#addToCart_1').click(function() {
    $('#task_1').val('ajax');
    $('#task_1').val('addToCart');
    $('#cartButtonForm_1').submit();
    return false;
    return false;
    });
    })
    })(jQuery);

    /* ]]> */

    And here it is from the form:

    /* <![CDATA[ */

    (function($){
    $(document).ready(function(){
    $('.Cart66AjaxWarning').hide();
    $('#addToCart_1_2').click(function() {
    $('#task_1_2').val('ajax');
    $('#task_1_2').val('addToCart');
    $('#cartButtonForm_1_2').submit();
    return false;
    return false;
    });
    })
    })(jQuery);

    /* ]]> */

    so - they seem identical and the spacing on close seems the same; so does this help any?

    Please let me know...

    Gerard

    Posted 6 years ago on Wednesday January 11, 2012 | Permalink
  5. Hello Chris: I wanted to check in and see if any progress has been made on this. I decided to do a further test to find out if this could be a "theme" or "plugin" conflict. I created a new subdomain and installed a totally fresh wordpress there. It only has the default theme of "twentyeleven" on it which comes with wordpress. I installed gravity forms and cart66 and those are the only plugins activated. This can be all viewed here:

    http://test4.charismaarts.com/?page_id=12

    I then setup a similar test and the exact same thing is happening. The cart66 button works fine on a page; but when you put it in a html block in a gravity form; the button no longer works. I hope that this establishes that this is not a theme or plugin conflict. So - Please let me know about this...

    Thanks,

    Gerard

    Posted 6 years ago on Tuesday January 24, 2012 | Permalink