Jump to content
thirty bees forum
  • 0

Amazon Pay - Cannot use object of type Carrier as array


SeaSky

Question

Hello

I've been testing the Amazon Pay module from Patworx, after loggin in with the test account from Amazon in sandbox mode I get an error, checked this post with a similar error, but it looks that in that case the issue was with the way the custom template was build and I am on the standard Thirty Bees theme.

This occurs on the last step of the five step checkout on TB 1.1.0.

Would apreciate any advice or guidance on how to solve the issue!

Thank you

Kind Regards

 

ThirtyBeesException
Cannot use object of type Carrier as array
when rendering smarty template modules/amzpayments/views/templates/front/amzpayments_checkout_bs.tpl
Source file: modules/amzpayments/views/templates/front/amzpayments_checkout_bs.tpl
1:{*
2:* Amazon Advanced Payment APIs Modul
3:* for Support please visit www.patworx.de
4:*
5:*  @author patworx multimedia GmbH <service@patworx.de>
6:*  In collaboration with alkim media
7:*  @copyright  2013-2015 patworx multimedia GmbH
8:*  @license    Released under the GNU General Public License
9:*}
10:<div id="amzOverlay"><img src="{$amz_module_path|escape:'htmlall':'UTF-8'}views/img/loading_indicator.gif" /></div>
11:
12:<div class="row">
13:	<div class="col-xs-12 col-sm-6" id="addressBookWidgetDivBs">
14:	</div>
15:	
16:	<div class="col-xs-12 col-sm-6" id="walletWidgetDivBs">
17:	</div>
18:	
19:	<div class="col-xs-12 col-sm-6" id="addressMissings">		
20:	</div>
21:	<input type="button" id="submitAddress" class="exclusive" value="{l s='Save' mod='amzpayments'}" name="submitAddress" style="display: none;">
22:</div>
23:
24:<div class="row">
25:	<div class="col-xs-12 amz_cart_widgets_bs">
26:		<div id="amz_carriers" style="display: none;">
27:			{include file="$tpl_dir./order-carrier.tpl"}
28:		</div>	
29:	</div>
30:</div>
31:<div class="row">
32:	<div class="col-xs-12 amz_cart_widgets_summary amz_cart_widgets_summary_bs" id="amz_cart_widgets_summary">
33:		{include file="$tpl_dir./shopping-cart.tpl"}
34:	</div>
35:</div>
36:
37:<div class="row">
38:	<div class="col-xs-12 text-right">
39:		{if $show_amazon_account_creation_allowed}
40:			{if $force_account_creation}
41:				<input type="hidden" id="connect_amz_account" value="1" name="connect_amz_account" />
42:			{else}
43:				<p class="checkbox">
44:					<input type="checkbox" id="connect_amz_account" value="1" name="connect_amz_account" {if $preselect_create_account}checked="checked"{/if}/>
45:					<label for="connect_amz_account">
46:						{l s='Create customer account.' mod='amzpayments'}
47:						<br />
48:						<span style="font-size: 10px;">{l s='You don\'t need to do anything. We create the account with the data of your current order.' mod='amzpayments'}</span>
49:					</label>
50:				</p>
51:			{/if}
52:		{/if}
53:		<input type="button" id="amz_execute_order" class="exclusive" value="{l s='Buy now' mod='amzpayments'}" name="Submit" disabled="disabled">
54:	</div>
55:</div>
56:<div style="clear:both"></div>
57:
58:{if $sandboxMode}
59:
60:{/if}
61:
62:{literal}
63:<script> 
64:var amazonCarrierErrorMessage = '{/literal}{l s='There are no carriers that deliver to the address you selected in your address book, please select another one.' mod='amzpayments'}{literal}';
65:var isFirstRun = true;
66:var amazonOrderReferenceId = '{/literal}{$amz_session|escape:'htmlall':'UTF-8'}{literal}';
67:var amzWidgetReadonly = false;
68:jQuery(document).ready(function($) {
69:	var amzAddressSelectCounter = 0;
70:	
71:	var redirectURL = LOGINREDIRECTAMZ;	
72:	
73:	new OffAmazonPayments.Widgets.AddressBook({
74:		sellerId: '{/literal}{$sellerID|escape:'htmlall':'UTF-8'}{literal}',
75:		{/literal}{if $amz_session == ''}{literal}
76:		onOrderReferenceCreate: function(orderReference) {			
77:			 amazonOrderReferenceId = orderReference.getAmazonOrderReferenceId();
78:             $.ajax({
79:                 type: 'GET',
80:                 url: REDIRECTAMZ,
81:                 data: 'allow_refresh=1&ajax=true&method=setsession&amazon_id=' + orderReference.getAmazonOrderReferenceId(),
82:                 success: function(htmlcontent){
83:                	 
84:                 }
85:        	});
86:		},
87:        {/literal}{/if}{literal}
88:		{/literal}{if $amz_session != ''}{literal}amazonOrderReferenceId: '{/literal}{$amz_session|escape:'htmlall':'UTF-8'}{literal}', {/literal}{/if}{literal}
89:		onAddressSelect: function(orderReference) {
90:			if (isFirstRun) {
91:				setTimeout(function() { 
92:					$("#carrier_area").hide();
93:					updateAddressSelection(amazonOrderReferenceId); 
94:					isFirstRun = false; 
95:					/*
96:					setTimeout(function() {
97:						updateAddressSelection(amazonOrderReferenceId);
98:						$("#carrier_area").fadeIn();
99:					}, 1000); 
100:					*/
101:				}, 1000);
102:			} else {
103:				updateAddressSelection(amazonOrderReferenceId);		
104:			}
105:		},
106:		design: {
107:			designMode: 'responsive'
108:		},
109:		{/literal}{if $trigger_payment_change}{literal}
110:		displayMode: "Read",		
111:		{/literal}{/if}{literal}
112:		onError: function(error) {
113:			console.log(error.getErrorCode());
114:			console.log(error.getErrorMessage());
115:		}
116:	}).bind("addressBookWidgetDivBs");
117:	
118:	walletWidget = new OffAmazonPayments.Widgets.Wallet({
119:		sellerId: '{/literal}{$sellerID|escape:'htmlall':'UTF-8'}{literal}',
120:		{/literal}{if $amz_session != ''}{literal}amazonOrderReferenceId: '{/literal}{$amz_session|escape:'htmlall':'UTF-8'}{literal}', {/literal}{/if}{literal}
121:		design: {
122:			designMode: 'responsive'
123:		},
124:		onPaymentSelect: function(orderReference) {
125:		},
126:		onError: function(error) {
127:			console.log(error.getErrorMessage());
128:		}
129:	});
130:	walletWidget.setPresentmentCurrency("{/literal}{$currency->iso_code|escape:'htmlall':'UTF-8'}{literal}");
131:	walletWidget.bind("walletWidgetDivBs");
132:	
133:});
134:
135:function reCreateWalletWidget() {
136:	$("#walletWidgetDivBs").html('');
137:	walletWidget = new OffAmazonPayments.Widgets.Wallet({
138:		sellerId: '{/literal}{$sellerID|escape:'htmlall':'UTF-8'}{literal}',
139:		{/literal}{if $amz_session != ''}{literal}amazonOrderReferenceId: '{/literal}{$amz_session|escape:'htmlall':'UTF-8'}{literal}', {/literal}{/if}{literal}
140:		design: {
141:			designMode: 'responsive'
142:		},
143:		onPaymentSelect: function(orderReference) {
144:			$("#cgv").trigger('change');
145:		},
146:		onError: function(error) {
147:			console.log(error.getErrorMessage());
148:		}
149:	});
150:	walletWidget.setPresentmentCurrency("{/literal}{$currency->iso_code|escape:'htmlall':'UTF-8'}{literal}");
151:	walletWidget.bind("walletWidgetDivBs");	
152:}
153:function reCreateAddressBookWidget() {
154:	$("#addressBookWidgetDivBs").html('');
155:	new OffAmazonPayments.Widgets.AddressBook({
156:		sellerId: '{/literal}{$sellerID|escape:'htmlall':'UTF-8'}{literal}',
157:		{/literal}{if $amz_session != ''}{literal}amazonOrderReferenceId: '{/literal}{$amz_session|escape:'htmlall':'UTF-8'}{literal}', {/literal}{/if}{literal}
158:		onAddressSelect: function(orderReference) {
159:			updateAddressSelection(amazonOrderReferenceId);			
160:		},
161:		displayMode: (amzWidgetReadonly ? "Read" : "Edit"),
162:		design: {
163:			designMode: 'responsive'
164:		},
165:		onError: function(error) {		
166:			console.log(error.getErrorMessage());
167:		}
168:	}).bind("addressBookWidgetDivBs");	
169:}
170:</script>
171:{/literal}
Stack trace
1. vendor/smarty/smarty/libs/sysplugins/smarty_template_resource_base.php:128 source content_5d81fd1e54c313_98582595(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	
string(86): "/usr/home/thebonvivantstore.com/web/themes/community-theme-default/./order-carri"...
#2	
null
#3	
null
#4	
0
#5	
3600
#6	
array(0) []
#7	
0
#8	
true
6. vendor/smarty/smarty/libs/sysplugins/smarty_template_resource_base.php:128 source content_5d81fd1e4ca357_54180598(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);
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 SeaSky
Link to comment
Share on other sites

1 answer to this question

Recommended Posts

  • 1

Playing with some options found out that modifying the order proces type on the module solved the issue:

Modules and Services > amzpayments > Configure > Miscellaneous > Order process type > Set to Standard (default is optimized)

Hope it helps someone,

Regards.

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...