Jump to content

  • You cannot start a new topic
  • You cannot reply to this topic

Paypal Finance Banner Rate Topic   - - - - -

 
  • notlim
  • Junior Member
  • Members
  • Join Date: 16-Mar 11
  • 223 posts

Posted 09 May 2018 - 06:41 PM #1

I am trying to create a banner for PayPal Finance Promotion

The code they gave is supposed to be HTML- It is supposed to be in a block 160X600

<script type="text/javascript" data-pp-payerid="2CPGRX43X3H2N" data-pp-placementtype="160x600" data-pp-style="WHTBLUYMED"> (function (d, t) {"use strict";var s = d.getElementsByTagName(t)[0], n = d.createElement(t);n.src = "//www.paypalobjects.com/upstream/bizcomponents/js/merchant.js";s.parentNode.insertBefore(n, s);}(document, "script")); </script>

 

On the page it comes up as text same as code and not like html.

<script type="text/javascript" data-pp-payerid="2CPGRX43X3H2N" data-pp-placementtype="160x600" data-pp-style="WHTBLUYMED"> (function (d, t) {"use strict";var s = d.getElementsByTagName(t)[0], n = d.createElement(t);n.src = "//www.paypalobjects.com/upstream/bizcomponents/js/merchant.js";s.parentNode.insertBefore(n, s);}(document, "script")); </script>

PlayPal tech thinks the problem is something to do with Javascript.

I tried HTML blocks and text banners but nothing works.

 

does anyone have an idea what the problem is?

thank you

 



 
  • tbirnseth
  • CS Cart Expert
  • Authorized Reseller
  • Join Date: 08-Nov 08
  • 10760 posts

Posted 09 May 2018 - 09:39 PM #2

Did you use the block manager to create the block?  Or how have you deployed the code?

 

The symptoms you are describing are that it's being put into a Smarty variable and then that variable is being displayed without the 'nofilter' modifier.  I.e. the variable syntax should be:

{$my_variable nofilter}

versus

{$my_variable}

EZ Merchant Solutions: Custom (USA based) B2B Development, Consulting, Development and Special Projects (get a quote here).
Commercial addons, payment methods and modifications to meet your business and operations needs.


 
  • eComLabs
  • CS-Cart Expert
  • Authorized Reseller
  • Join Date: 27-Jan 14
  • 17801 posts

Posted 10 May 2018 - 06:07 AM #3

Did you try HTML block with SMARTY support, where WYSIWYG is not used?


GET A FREE QUOTE | CS-Cart Add-ons | CS-Cart Licenses | CS-Cart Development | CS-Cart Design | Server Configuration | UniTheme and YOUPI
CS-Cart                USD 345     Multi-Vendor              USD 1250    CS-Cart RU                         24500 руб.
CS-Cart Ultimate  USD 775     CS-Cart + YOUPI      USD 545      CS-Cart RU + UniTheme    36000 руб.


 
  • notlim
  • Junior Member
  • Members
  • Join Date: 16-Mar 11
  • 223 posts

Posted 10 May 2018 - 05:31 PM #4

EZ  I was careful to avoid the blocks that contained smarty support. I used the Banners Block and the "any HTML content" block and each time created a new block to work with.

Are you suggesting that I have to change something in the cart/block settings or something in the PayPal code has to change? 

 

 

 

 

ecom- I just tried the html with smarty support and got this

 

Syntax error in template "264270203fa23c3ee031facb3cb6839260d6dbe8" on line 2 "(function (d, t) {"use strict";var s = d.getElementsByTagName(t)[0], n = d.createElement(t);n.src = "//www.paypalobjects.com/upstream/bizcomponents/js/merchant.js";s.parentNode.insertBefore(n, s);}(document, "script"));" - Unexpected ";", expected one of: "}"

 

 

Attached Thumbnails

  • Banner block also tried same result.png
  • block with HTML content -no smarty.png
  • Content of Block -paypal c0de.png
  • HTML block used general view.png
  • PP banner reults.png


 
  • tbirnseth
  • CS Cart Expert
  • Authorized Reseller
  • Join Date: 08-Nov 08
  • 10760 posts

Posted 10 May 2018 - 07:06 PM #5

As ecom said, you need to be using an html block with smarty support otherwise the tags will be escaped as html entities. 

 

To prevent the errors, wrap your code in literal tags like:

{literal}
  <script type="text/javascript" data-pp-payerid="2CPGRX43X3H2N" data-pp-placementtype="160x600" data-pp-style="WHTBLUYMED"> (function (d, t) {"use strict";var s = d.getElementsByTagName(t)[0], n = d.createElement(t);n.src = "//www.paypalobjects.com/upstream/bizcomponents/js/merchant.js";s.parentNode.insertBefore(n, s);}(document, "script")); </script>
{/literal}

 

For simplicity think about it as if you have '{' and '}' on the same line, then it assumes that what's between them is a Smarty variable.

 

You could also alter the script text to have it read like:

  <script type="text/javascript" data-pp-payerid="2CPGRX43X3H2N" data-pp-placementtype="160x600" data-pp-style="WHTBLUYMED"> 
    (function (d, t) {
      "use strict";
      var s = d.getElementsByTagName(t)[0],
      n = d.createElement(t);n.src = "//www.paypalobjects.com/upstream/bizcomponents/js/merchant.js";s.parentNode.insertBefore(n, s);
    }(document, "script")
  );
  </script>

whch puts the '{' and '}' on separate lines.


EZ Merchant Solutions: Custom (USA based) B2B Development, Consulting, Development and Special Projects (get a quote here).
Commercial addons, payment methods and modifications to meet your business and operations needs.


 
  • notlim
  • Junior Member
  • Members
  • Join Date: 16-Mar 11
  • 223 posts

Posted 13 May 2018 - 03:55 PM #6

I have tried EZ's code -no results. I then added <literal> no results.

I changed to a black background PayPal code and then I got an error code that I can't figure out -but at least I have something.

Can you tell me what the error code tells me to do?

The PP code is

<script type="text/javascript" data-pp-payerid="2CPGRX43X3H2N" data-pp-placementtype="160x600" data-pp-style="BLKWHTYMED">
 (function (d, t) {"use strict";var s = d.getElementsByTagName(t)[0], n = d.createElement(t);n.src = "//www.paypalobjects.com/upstream/bizcomponents/js/merchant.js";s.parentNode.insertBefore(n, s);}(document, "script"));
</script>
The error code is
Syntax error in template "3e4e8b68a1b25a407a60ad385b2d78a15b7db720" on line 2 "(function (d, t) {"use strict";var s = d.getElementsByTagName(t)[0], n = d.createElement(t);n.src = "//www.paypalobjects.com/upstream/bizcomponents/js/merchant.js";s.parentNode.insertBefore(n, s);}(document, "script"));" - Unexpected ";", expected one of: "}"
 
I tried changing wrappers, doesn't help.
I can't believe that PayPal would create such a difficult code. I had one of their technicians on the line for an hour and he couldn't help me. He says that he tried it on his end and it worked.
There must be someone else out there that uses PayPal and their banner. Am I the only one with the problem?


 
  • tbirnseth
  • CS Cart Expert
  • Authorized Reseller
  • Join Date: 08-Nov 08
  • 10760 posts

Posted 13 May 2018 - 06:03 PM #7

It is a smarty error and will not happen if you either user 'literal' tags or you break the code down so that '{' an '}' don't appear on the same lines.  It has nothing to do with paypal.

 

Any time you see the phrase "error in template" in an error message, that is a smarty error and not related to the code itself.


EZ Merchant Solutions: Custom (USA based) B2B Development, Consulting, Development and Special Projects (get a quote here).
Commercial addons, payment methods and modifications to meet your business and operations needs.


 
  • eComLabs
  • CS-Cart Expert
  • Authorized Reseller
  • Join Date: 27-Jan 14
  • 17801 posts

Posted 14 May 2018 - 06:42 AM #8

You should add data-no-defer parameter to the script. Please use HTML block with SMARTY support and the following code.

{literal}
<script type="text/javascript" data-pp-payerid="2CPGRX43X3H2N" data-pp-placementtype="160x600" data-pp-style="BLKWHTYMED" data-no-defer>
 (function (d, t) {"use strict";var s = d.getElementsByTagName(t)[0], n = d.createElement(t);n.src = "//www.paypalobjects.com/upstream/bizcomponents/js/merchant.js";s.parentNode.insertBefore(n, s);}(document, "script"));
</script>
{/literal}

Tested on the demo

 

 

http://prntscr.com/jhjqp6


GET A FREE QUOTE | CS-Cart Add-ons | CS-Cart Licenses | CS-Cart Development | CS-Cart Design | Server Configuration | UniTheme and YOUPI
CS-Cart                USD 345     Multi-Vendor              USD 1250    CS-Cart RU                         24500 руб.
CS-Cart Ultimate  USD 775     CS-Cart + YOUPI      USD 545      CS-Cart RU + UniTheme    36000 руб.


 
  • notlim
  • Junior Member
  • Members
  • Join Date: 16-Mar 11
  • 223 posts

Posted 15 May 2018 - 01:56 PM #9

eCom- Thank you again-it works.



 
  • eComLabs
  • CS-Cart Expert
  • Authorized Reseller
  • Join Date: 27-Jan 14
  • 17801 posts

Posted 16 May 2018 - 05:42 AM #10

You are welcome!


GET A FREE QUOTE | CS-Cart Add-ons | CS-Cart Licenses | CS-Cart Development | CS-Cart Design | Server Configuration | UniTheme and YOUPI
CS-Cart                USD 345     Multi-Vendor              USD 1250    CS-Cart RU                         24500 руб.
CS-Cart Ultimate  USD 775     CS-Cart + YOUPI      USD 545      CS-Cart RU + UniTheme    36000 руб.