Jump to content
thirty bees forum
  • 0

OPC checkout and custom payment


Raymond

Question

Hello

I upgraded from TB 1.08 to 1.1

All seemed fine, then I found out to have to see the order status page in order to have the database fixed creating two columns that core updater still does not do

However further testing i discovered that in the checkout process having the native OPC activated I get a 500 internal error page.

In the error message there is a link to download an encrypted error log, how can I decrypt it to read the content?

So I switched to the 5 steps checkout, this work, but the custom payments I created are shown four times each.

I do use transformer theme.

What should I look at to give you more info?

What can I do to fix this?

Thank you

Kind regards

 

About using the OPC I reached to get this error message

ThirtyBeesException

Cannot use object of type Carrier as array

when rendering smarty template themes/transformer/order-opc.tpl

Source file: themes/transformer/order-opc.tpl

1:{*
2:* 2007-2014 PrestaShop
3:*
4:* NOTICE OF LICENSE
5:*
6:* This source file is subject to the Academic Free License (AFL 3.0)
7:* that is bundled with this package in the file LICENSE.txt.
8:* It is also available through the world-wide-web at this URL:
9:* http://opensource.org/licenses/afl-3.0.php
10:* If you did not receive a copy of the license and are unable to
11:* obtain it through the world-wide-web, please send an email
12:* to license@prestashop.com so we can send you a copy immediately.
13:*
14:* DISCLAIMER
15:*
16:* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
17:* versions in the future. If you wish to customize PrestaShop for your
18:* needs please refer to http://www.prestashop.com for more information.
19:*
20:*  @author PrestaShop SA <contact@prestashop.com>
21:*  @copyright  2007-2014 PrestaShop SA
22:*  @license    http://opensource.org/licenses/afl-3.0.php  Academic Free License (AFL 3.0)
23:*  International Registered Trademark & Property of PrestaShop SA
24:*}
25:
26:{if $opc}
27:	{assign var="back_order_page" value="order-opc.php"}
28:	{else}
29:	{assign var="back_order_page" value="order.php"}
30:{/if}
31:
32:{if $PS_CATALOG_MODE}
33:	{capture name=path}{l s='Your shopping cart'}{/capture}
34:	<h2 id="cart_title">{l s='Your shopping cart'}</h2>
35:	<p class="alert alert-warning">{l s='Your new order was not accepted.'}</p>
36:{else}
37:	{if $productNumber}
38:		<!-- Shopping Cart -->
39:		{include file="$tpl_dir./shopping-cart.tpl"}
40:		<!-- End Shopping Cart -->
41:		{if $is_logged AND !$is_guest}
42:			{include file="$tpl_dir./order-address.tpl"}
43:		{else}
44:			<!-- Create account / Guest account / Login block -->
45:			{include file="$tpl_dir./order-opc-new-account.tpl"}
46:			<!-- END Create account / Guest account / Login block -->
47:		{/if}
48:		<!-- Carrier -->
49:		{include file="$tpl_dir./order-carrier.tpl"}
50:		<!-- END Carrier -->
51:	
52:		<!-- Payment -->
53:		{include file="$tpl_dir./order-payment.tpl"}
54:		<!-- END Payment -->
55:	{else}
56:		{capture name=path}{l s='Your shopping cart'}{/capture}
57:		<h2 class="page-heading">{l s='Your shopping cart'}</h2>
58:		{include file="$tpl_dir./errors.tpl"}
59:		<p class="alert alert-warning">{l s='Your shopping cart is empty.'}</p>
60:	{/if}
61:{strip}
62:{addJsDef imgDir=$img_dir}
63:{addJsDef authenticationUrl=$link->getPageLink("authentication", true)|escape:'quotes':'UTF-8'}
64:{addJsDef orderOpcUrl=$link->getPageLink("order-opc", true)|escape:'quotes':'UTF-8'}
65:{addJsDef historyUrl=$link->getPageLink("history", true)|escape:'quotes':'UTF-8'}
66:{addJsDef guestTrackingUrl=$link->getPageLink("guest-tracking", true)|escape:'quotes':'UTF-8'}
67:{addJsDef addressUrl=$link->getPageLink("address", true, NULL, "back={$back_order_page}")|escape:'quotes':'UTF-8'}
68:{addJsDef orderProcess='order-opc'}
69:{addJsDef guestCheckoutEnabled=$PS_GUEST_CHECKOUT_ENABLED|intval}
70:{addJsDef displayPrice=$priceDisplay}
71:{addJsDef taxEnabled=$use_taxes}
72:{addJsDef conditionEnabled=$conditions|intval}
73:{addJsDef vat_management=$vat_management|intval}
74:{addJsDef errorCarrier=$errorCarrier|@addcslashes:'\''}
75:{addJsDef errorTOS=$errorTOS|@addcslashes:'\''}
76:{addJsDef checkedCarrier=$checked|intval}
77:{addJsDef addresses=array()}
78:{addJsDef isVirtualCart=$isVirtualCart|intval}
79:{addJsDef isPaymentStep=$isPaymentStep|intval}
80:{addJsDefL name=txtWithTax}{l s='(tax incl.)' js=1}{/addJsDefL}
81:{addJsDefL name=txtWithoutTax}{l s='(tax excl.)' js=1}{/addJsDefL}
82:{addJsDefL name=txtHasBeenSelected}{l s='has been selected' js=1}{/addJsDefL}
83:{addJsDefL name=txtNoCarrierIsSelected}{l s='No carrier has been selected' js=1}{/addJsDefL}
84:{addJsDefL name=txtNoCarrierIsNeeded}{l s='No carrier is needed for this order' js=1}{/addJsDefL}
85:{addJsDefL name=txtConditionsIsNotNeeded}{l s='You do not need to accept the Terms of Service for this order.' js=1}{/addJsDefL}
86:{addJsDefL name=txtTOSIsAccepted}{l s='The service terms have been accepted' js=1}{/addJsDefL}
87:{addJsDefL name=txtTOSIsNotAccepted}{l s='The service terms have not been accepted' js=1}{/addJsDefL}
88:{addJsDefL name=txtThereis}{l s='There is' js=1}{/addJsDefL}
89:{addJsDefL name=txtErrors}{l s='Error(s)' js=1}{/addJsDefL}
90:{addJsDefL name=txtDeliveryAddress}{l s='Delivery address' js=1}{/addJsDefL}
91:{addJsDefL name=txtInvoiceAddress}{l s='Invoice address' js=1}{/addJsDefL}
92:{addJsDefL name=txtModifyMyAddress}{l s='Modify my address' js=1}{/addJsDefL}
93:{addJsDefL name=txtInstantCheckout}{l s='Instant checkout' js=1}{/addJsDefL}
94:{addJsDefL name=txtSelectAnAddressFirst}{l s='Please start by selecting an address.' js=1}{/addJsDefL}
95:{addJsDefL name=txtFree}{l s='Free' js=1}{/addJsDefL}
96:
97:{capture}{if $back}&mod={$back|urlencode}{/if}{/capture}
98:{capture name=addressUrl}{$link->getPageLink('address', true, NULL, 'back='|cat:$back_order_page|cat:'?step=1'|cat:$smarty.capture.default)|escape:'quotes':'UTF-8'}{/capture}
99:{addJsDef addressUrl=$smarty.capture.addressUrl}
100:{capture}{'&multi-shipping=1'|urlencode}{/capture}
101:{addJsDef addressMultishippingUrl=$smarty.capture.addressUrl|cat:$smarty.capture.default}
102:{capture name=addressUrlAdd}{$smarty.capture.addressUrl|cat:'&id_address='}{/capture}
103:{addJsDef addressUrlAdd=$smarty.capture.addressUrlAdd}
104:{addJsDef opc=$opc|boolval}
105:{capture}<h3 class="page-subheading">{l s='Your billing address' js=1}</h3>{/capture}
106:{addJsDefL name=titleInvoice}{$smarty.capture.default|@addcslashes:'\''}{/addJsDefL}
107:{capture}<h3 class="page-subheading">{l s='Your delivery address' js=1}</h3>{/capture}
108:{addJsDefL name=titleDelivery}{$smarty.capture.default|@addcslashes:'\''}{/addJsDefL}
109:{capture}<a class="btn btn-default" href="{$smarty.capture.addressUrlAdd}" title="{l s='Update' js=1}">{l s='Update' js=1}</a>{/capture}
110:{addJsDefL name=liUpdate}{$smarty.capture.default|@addcslashes:'\''}{/addJsDefL}
111:{/strip}
112:{/if}

Stack trace

1. vendor/smarty/smarty/libs/sysplugins/smarty_template_resource_base.php:128 source content_5d476ec0a291a0_45265484(arguments)
2. vendor/smarty/smarty/libs/sysplugins/smarty_template_compiled.php:172 source Smarty_Template_Resource_Base->getRenderedTemplateCode(arguments)
3. vendor/smarty/smarty/libs/sysplugins/smarty_internal_template.php:206 source Smarty_Template_Compiled->render(arguments)
4. vendor/smarty/smarty/libs/sysplugins/smarty_internal_template.php:372 source Smarty_Internal_Template->render()
5. Smarty_Internal_Template->_subTemplateRender(arguments)
#1
".../themes/transformer/./order-carrier.tpl"
#2
null
#3
null
#4
0
#5
31536000
#6
array(0) []
#7
0
#8
true
6. vendor/smarty/smarty/libs/sysplugins/smarty_template_resource_base.php:128 source content_5d476ec059c640_53267765(arguments)
7. vendor/smarty/smarty/libs/sysplugins/smarty_template_compiled.php:172 source Smarty_Template_Resource_Base->getRenderedTemplateCode(arguments)
8. vendor/smarty/smarty/libs/sysplugins/smarty_internal_template.php:206 source Smarty_Template_Compiled->render(arguments)
9. vendor/smarty/smarty/libs/sysplugins/smarty_internal_templatebase.php:216 source Smarty_Internal_Template->render(arguments)
10. vendor/smarty/smarty/libs/sysplugins/smarty_internal_templatebase.php:107 source Smarty_Internal_TemplateBase->_execute(arguments)
11. classes/SmartyCustom.php:180 source Smarty_Internal_TemplateBase->fetch(arguments)
12. classes/controller/FrontController.php:984 source SmartyCustomCore->fetch(arguments)
965:                $this->js_files = Media::cccJs($this->js_files);
966:            }
967:        }
968:
969:        $this->context->smarty->assign(
970:            [
971:                'css_files'      => $this->css_files,
972:                'js_files'       => ($this->getLayout() && (bool) Configuration::get('PS_JS_DEFER')) ? [] : $this->js_files,
973:                'js_defer'       => (bool) Configuration::get('PS_JS_DEFER'),
974:                'errors'         => $this->errors,
975:                'display_header' => $this->display_header,
976:                'display_footer' => $this->display_footer,
977:                'img_formats'    => ['webp' => 'image/webp', 'jpg' => 'image/jpeg']
978:            ]
979:        );
980:
981:        $layout = $this->getLayout();
982:        if ($layout) {
983:            if ($this->template) {
984:                $template = $this->context->smarty->fetch($this->template);
985:            } else {
986:                // For retrocompatibility with 1.4 controller
987:
988:                ob_start();
989:                $this->displayContent();
990:                $template = ob_get_contents();
991:                ob_clean();
992:            }
993:            $this->context->smarty->assign('template', $template);
994:            $this->smartyOutputContent($layout);
#1
".../themes/transformer/order-opc.tpl"
13. classes/controller/Controller.php:226 source FrontControllerCore->display()
14. classes/controller/FrontController.php:253 source ControllerCore->run()
15. classes/Dispatcher.php:837 source FrontControllerCore->run()
16. ./index.php:33 source DispatcherCore->dispatch()
Edited by Raymond
added error message
Link to comment
Share on other sites

Recommended Posts

  • 1
1 hour ago, Occam said:

I'm afraid you missed the point. This is not about Transformer, it's about thirtybees 1.1.0. The previous release 1.0.8 seems to be fully compatible with he Transformer theme, but 1.1.0 is not (or let's say only 90%). So it's up to the programmers of thirtybees 1.1.0 to find out what happened. Seems to be a little bit tricky, I guess.

The issue is very well understood, and it was explained few times already.

The problem is that the ps16 default theme (and most of the themes that derives from it, including Transformer, Panda, Community Theme, and Niara) contains a bug. This bug seems to be present in the code from the very beginning, and it looks something like this (pseudocode)

{foreach $list as $item}
  ... 
  // work with $item variable inside the loop is ok, as we are in the scope
  ...
{/foreach}
....
// access $item variable should not work, because we are outside the loop scope
$item->doSomething();

Basically, original theme developer accessed variable after the loop ended, even though this variable *should't* exists anymore. It was declared in foreach loop, and the loop should be its scope. Unfortunately, older version of smarty allowed this operation -- the variable pointed to the last item in the $list. I believe that this should be considered bug in smarty engine (and that's probably why they fixed it). Because of this, the theme somewhat worked, even though it didn't displayed data correctly (in our case it displayed delivery time for the last carrier only, other carriers were displayed without delivery delay information)

Thirtybees 1.1.0 upgraded smarty from version 3.1.19 to 3.1.31. This move was really necessary. The 3.1.19 version was already 5 years old, and it was reporting deprecation warnings on php 7.1/7.2. It would stopped working on future php versions. The upgrade was long due, and should have been made much sooner. The side effect of this upgrade is that this bug that our themes depends on is has been fixed.

Now, it's hard to fix this issue from the core, mainly because there is nothing wrong in the core itself. The problem is, and always was, in the themes. Thirtybees team localized, and fixed this problem in the themes they own (niara and community-default). But it's not possible (well, it's possible, but very hard) to fix it in the third party code.

This is the first *big* compatibility issue I've seen in this project. These are bound to happen sometimes, and it hurts. But rest assured that thirtybees team is trying hard to prevent this, unless absolutely necessary. 

 

Link to comment
Share on other sites

  • 0

Did you update to the latest version of Transformer theme?  Did you check to make sure it’s compatible with 1.1.0. I had to wait until Jonny updated Panda before I could upgrade. 

 

if I go to Jonny's site it doesn't show TB compatibility

  • Compatibility with:
    • PS 1.7.1.0 - 1.7.6.0,
    • PS 1.6.0.5 - 1.6.1.24,
    • PS 1.5.4.0 - 1.5.6.3
Edited by Factor
Link to comment
Share on other sites

  • 0
On 8/10/2019 at 5:55 AM, Raymond said:
No, transformer is not compatible with TB.

@Raymond @Factor

I cannot confirm this. As well as you can make Transformer (if fully adapted to PHP 7) run smoothly with Prestashop 1.5.6x and 1.6.1x (both either with PHP 5.6, 7.0, 7.1, 7.2, 7.3 [only PS 1.5.6]), you can use it perfectly with TB 1.08, and even with 1.1.0. But the latter needs some minor CSS improvements both in product view, list views and checkout.

1.08: Tested under XAMPP with PHP 7.2.13 and AEUC _mod by eleazar. Both OPC and 5-Step checkout.

1.1.0: Tested under XAMPP with PHP 7.2.13 and AEUC _mod by eleazar. Both OPC and 5-Step checkout.

OPC in 1.1.0 doesn't work yet, 5-step checkout works. But this is not a bug caused by the Transformer theme.  OPC in 1.1.0 works after applying the following fix: https://forum.thirtybees.com/topic/3320-thirty-bees-110-is-released/?do=findComment&comment=29715

Though I did not test the behavior under PHP 7.0 and 7.1 I wouldn't expect any problems.

Edited by Occam
  • Like 1
Link to comment
Share on other sites

  • 0

I am sure that Transformer and Panda can become fully compatible with TB 1.1, however as we saw a few fixes are still necessary, would be very nice of Sunnytoo to fix it all and include it in their releases for both themes (I guess that they are going to do it hopefully).

I am testing ST Transformer under PHP 7.1, TB 1.1, it works fine apparently, but still I did not test many features, alike layered search, combinations, specific price reductions, bundles and so on.

In fact after adding a lot of features , lots of attributes, some suppliers and manufacturers, wanting to begin to test related products, combinations, specific prices, and layered navigation I got stuck because of a Jquery problem, I opened a post for that:

I am going to revert step by step hoping to find what where the changes that lead to it.

Btw, this halted my tests, I am not keen on waiting minutes each time I attempt to edit a product and in general to ignore this issue, need to have it fixed and understand what causes it.

Because of that I still have to see if everything else works fine with Transformer (and would really like to, I am a bit in a hurry to publish the new website).

Link to comment
Share on other sites

  • 0
2 hours ago, Raymond said:

I am sure that Transformer and Panda can become fully compatible with TB 1.1

I'm afraid you missed the point. This is not about Transformer, it's about thirtybees 1.1.0. The previous release 1.0.8 seems to be fully compatible with he Transformer theme, but 1.1.0 is not (or let's say only 90%). So it's up to the programmers of thirtybees 1.1.0 to find out what happened. Seems to be a little bit tricky, I guess.

Edited by Occam
Link to comment
Share on other sites

  • 0

Alright, yes, I got it, it should be that way, logically retro compatibility should be maintained.

I do not know if this is a strict guideline in the TB roadmap and constitution, as I hope it is, in fact I feared that event of retro compatibility breach and it happened, that was not good to be seen.

However, I can understand that some changes might be unavoidable at times and some exception might be justified if the advantages obtained are really important and great.

Overall I truly hope that is possible to strongly enhance the system without throwing in the trash the whole addons/themes catalogue, would make no sense at all and would reproduce the Prestahop 1.7 "disaster".

Now, as not expert, I am not capable to discern if in this case this incompatibility is due to just something missing/erroneous in TB 1.1 or because any major change imposed to break something, from what you wrote I understand now that this is very simply some error or missing thing in the TB 1.1.

All what I understand of this is a derivation of what I can read here in this forum and other sources, + my non expert reasoning, reading that "a new version of panda, compatible with TB, will be released... " lead me to think that in TB 1.1 there are some unavoidable changes, if that is not the case, well, I stress on the concept of retro compatibility.

I am here because I found the prestashop policy a total failure (almost an insult to everyone, developers and end users).

I do not like that kind of scissor used in such not careful, senseless and lousy way in a development line (especially if the result is a tasteless buggy sort of soup alike just as prestashop 1.7 looked to be to me...)

Either ways, I hope that in future this is not going to be a problem, retro compatibility is too important to avoid serious troubles.

Edited by Raymond
Link to comment
Share on other sites

  • 0

Hi Petr

I remember to have read about the smarty engine version change, due to my ignorance I did not get immediately that this is the culprit for those minor changes now necessary in the third parties themes, or simply I forgot about that right after reading it, but I kept as true in my mind that changes were necessary.

Thanks to your precise explanation written in perfect divulgation language style I now I fully understood the whole case.

I am very happy of the work done by the Thirty Bees team, according to me as a final user is very good and reasonably I am pretty keen on accepting changes when really needed, we must be very reasonable in this respect.

Thank you.

Best regards

Ray

 

 

Link to comment
Share on other sites

  • 0
38 minutes ago, datakick said:

This is the first *big* compatibility issue I've seen in this project.

Then perhaps it is currently suggested not to upgrade to 1.1.0 because of more incompatibility issues. Because I do not think we're just talking about themes, we are talking about modules, too. Maybe due to Smarty, maybe not.

Transformer theme with ....

Thirtybees 1.0.8:

image.thumb.png.cd5c1cdbf84f68c2dcdec73b24e9218a.png

Same page with distorted picture frames in Thirtybees 1.1.0:

image.thumb.png.31738c908ab5216aaf892d07d17a2ca3.png

 

And btw "the first *big* compatibility issue"  you mentioned is already fixed here.

Edited by Occam
  • Like 1
Link to comment
Share on other sites

  • 0

if that's not the case right now, then it's gonna happen. Don't get me wrong. You and Markus are doing a great job. Really, but ....
Do you know Murphy's law? If something can go wrong, it will. Look, the developers of Prestashop 1.7 currently share the same hubris, and that's why Prestashop 1.7 is going to be a disaster. And Prestashop is much bigger than thirtybees. When the tail wags the dog, that'll end up bad. I wouldn't agree that a small project like thirtybees can afford to dictate the standards to third party developers. You would? Really?

I'm afraid it's just the other way round.

Link to comment
Share on other sites

  • 0
On 8/11/2019 at 7:47 AM, Occam said:
No, transformer is not compatible with TB.

@Raymond @Factor

I cannot confirm this. As well as you can make Transformer (if fully adapted to PHP 7) run smoothly with Prestashop 1.5.6x and 1.6.1x (both either with PHP 5.6, 7.0, 7.1, 7.2, 7.3 [only PS 1.5.6]), you can use it perfectly with TB 1.08, and even with 1.1.0. But the latter needs some minor CSS improvements both in product view, list views and checkout.

As I pointed out in my first post The creator of the theme states its not fully compatible.  That is good enough for me..

 

Like @colorful-ant said as well.

2 hours ago, colorful-ant said:

transformer theme is not full compatible

 

Link to comment
Share on other sites

  • 0

@Factor If such a statement is enough for you to reassure yourself, then be it.
I was assured by the same developer of Transformer that a Prestashop 1.5 with Transformer will not run under PHP 7.0 up to 7.3.
And should I tell you something: it's not true. He could be personally convinced of that. Transformer is an outstanding theme, which can be customized perfectly. That's why I don't rely on statements but try out in practice what works and what doesn't.

Link to comment
Share on other sites

  • 0
13 hours ago, wakabayashi said:

What are you talking about? :S

About the screenshots. Can we check the html code somewhere? To me this looks like a css or html issue.

That's for sure, but with exactly the same Transformer configuration. So you should always keep in mind that currently TB ought to be compatible with third party themes and not vice versa. Theme developers must also calculate whether the effort of a change is profitable for them. And what applies to Transformer probably also applies to other third party themes: first and foremost, tb must be compatible. Anything else would currently mean suicide for a most ambitious project. I guess this is not what we all want.

Edited by Occam
Link to comment
Share on other sites

  • 0
1 hour ago, wakabayashi said:

If it were my store I would compare the two version.

That's what I did. It is exactly the same, html and css. And even if I load a modified style in both tb releases, this bug (not the only one) in 1.1.0 persists. Which suggests that there must be something new in 1.1.0 that makes Transfomer perform poorly. And there are quite a lot changes from1.0.8 to 1.1.0, n'est-pas!

Edited by Occam
Link to comment
Share on other sites

  • 0

Yes, and I meanwhile found the reason why. During the install process the image height is not generated and therefor set to 0px for every image type.

image.thumb.png.a302e19932f8610c1abf4d121f2fe3dd.png

After adjusting the height and regenerating the thumbnails everything works fine. This bug was introduced with 1.1.0. 

This is how it looks after fixing some the missing declarations:

image.thumb.png.94a3464e8eb6019295d5a000bccece11.png

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...