Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Parse error: syntax error, unexpected T_DOUBLE_ARROW


Recommended Posts

Ive currently installed Giftwrap v1.1 and I am experiencing this error at the checkout at checkout_shipping.php

 

Parse error: syntax error, unexpected T_DOUBLE_ARROW in /home/public_html/catalog-dreamgirl/osc/includes/classes/order.php on line 56

 

Below I have provided lines 50-72

 

Any help would great! Thank you in advance

 

 

 

 

$giftwrap_method_query = tep_db_query("select title from " . TABLE_ORDERS_TOTAL . " where orders_id = '" . $order_id . "' and class = 'ot_giftwrap'");

$giftwrap_method = tep_db_fetch_array($giftwrap_method_query);

 

$order_status_query = tep_db_query("select orders_status_name from " . TABLE_ORDERS_STATUS . " where orders_status_id = '" . $order['orders_status'] . "' and language_id = '" . (int)$languages_id . "'");

$order_status = tep_db_fetch_array($order_status_query);

 

'shipping_method' => ((substr($shipping_method['title'], -1) == ':') ? substr(strip_tags($shipping_method['title']), 0, -1) : strip_tags($shipping_method['title'])));<----

 

 

'giftwrap_method' => ((substr($giftwrap_method['title'], -1) == ':') ? substr(strip_tags($giftwrap_method['title']), 0, -1) : strip_tags($giftwrap_method['title'])),

 

$this->info = array('currency' => $order['currency'],

'currency_value' => $order['currency_value'],

'payment_method' => $order['payment_method'],

'cc_type' => $order['cc_type'],

'cc_owner' => $order['cc_owner'],

'cc_number' => $order['cc_number'],

'cc_expires' => $order['cc_expires'],

'date_purchased' => $order['date_purchased'],

'orders_status' => $order_status['orders_status_name'],

'last_modified' => $order['last_modified'],

'total' => strip_tags($order_total['text']),

'shipping_method' => ((substr($shipping_method['title'], -1) == ':') ? substr(strip_tags($shipping_method['title']), 0, -1) : strip_tags($shipping_method['title'])));

Highvisualproducts

Link to comment
Share on other sites

It is a syntax error, indeed! :)

 

Move lines with "=>" under $this->info = array(...) You used operator of array elements assignment outside of array. Check for another line with

'shipping_method' to see where it should be and move 'giftwrap_method' there too.

 

Shimon

 

Ive currently installed Giftwrap v1.1 and I am experiencing this error at the checkout at checkout_shipping.php

 

Parse error: syntax error, unexpected T_DOUBLE_ARROW in /home/public_html/catalog-dreamgirl/osc/includes/classes/order.php on line 56

 

Below I have provided lines 50-72

 

Any help would great! Thank you in advance

 

 

 

 

$giftwrap_method_query = tep_db_query("select title from " . TABLE_ORDERS_TOTAL . " where orders_id = '" . $order_id . "' and class = 'ot_giftwrap'");

$giftwrap_method = tep_db_fetch_array($giftwrap_method_query);

 

$order_status_query = tep_db_query("select orders_status_name from " . TABLE_ORDERS_STATUS . " where orders_status_id = '" . $order['orders_status'] . "' and language_id = '" . (int)$languages_id . "'");

$order_status = tep_db_fetch_array($order_status_query);

 

'shipping_method' => ((substr($shipping_method['title'], -1) == ':') ? substr(strip_tags($shipping_method['title']), 0, -1) : strip_tags($shipping_method['title'])));<----

 

 

'giftwrap_method' => ((substr($giftwrap_method['title'], -1) == ':') ? substr(strip_tags($giftwrap_method['title']), 0, -1) : strip_tags($giftwrap_method['title'])),

 

$this->info = array('currency' => $order['currency'],

'currency_value' => $order['currency_value'],

'payment_method' => $order['payment_method'],

'cc_type' => $order['cc_type'],

'cc_owner' => $order['cc_owner'],

'cc_number' => $order['cc_number'],

'cc_expires' => $order['cc_expires'],

'date_purchased' => $order['date_purchased'],

'orders_status' => $order_status['orders_status_name'],

'last_modified' => $order['last_modified'],

'total' => strip_tags($order_total['text']),

'shipping_method' => ((substr($shipping_method['title'], -1) == ':') ? substr(strip_tags($shipping_method['title']), 0, -1) : strip_tags($shipping_method['title'])));

Link to comment
Share on other sites

And there was me thinking it was just having too many closing brackets.

Need help installing add ons/contributions, cleaning a hacked site or a bespoke development, check my profile

 

Virus Threat Scanner

My Contributions

Basic install answers.

Click here for Contributions / Add Ons.

UK your site.

Site Move.

Basic design info.

 

For links mentioned in old answers that are no longer here follow this link Useful Threads.

 

If this post was useful, click the Like This button over there ======>>>>>.

Link to comment
Share on other sites

Heya,

 

Thank you for your help, i have attempted this but have not solved anything could i be cheeky and ask for an example to check i am doing it correctly please

 

Many Thanks

Louise

'shipping_method' => ((substr($shipping_method['title'], -1) == ':') ? substr(strip_tags($shipping_method['title']), 0, -1) : strip_tags($shipping_method['title'])));<----

 

should be

 

'shipping_method' => ((substr($shipping_method['title'], -1) == ':') ? substr(strip_tags($shipping_method['title']), 0, -1) : strip_tags($shipping_method['title']));

 

is my guess

Link to comment
Share on other sites

No you removed the third bracket, should have been the first one

 

'shipping_method' => ((substr($shipping_method['title'], -1) == ':') ? substr(strip_tags($shipping_method['title']), 0, -1) : strip_tags($shipping_method['title']));

 

:-)

Need help installing add ons/contributions, cleaning a hacked site or a bespoke development, check my profile

 

Virus Threat Scanner

My Contributions

Basic install answers.

Click here for Contributions / Add Ons.

UK your site.

Site Move.

Basic design info.

 

For links mentioned in old answers that are no longer here follow this link Useful Threads.

 

If this post was useful, click the Like This button over there ======>>>>>.

Link to comment
Share on other sites

No you removed the third bracket, should have been the first one

 

'shipping_method' => ((substr($shipping_method['title'], -1) == ':') ? substr(strip_tags($shipping_method['title']), 0, -1) : strip_tags($shipping_method['title']));

 

:-)

OMG, you are right. :rolleyes:

Link to comment
Share on other sites

Hi,

 

Thank you for all your helps guys its really appreciated but unfortunatly I have tried all of the above and I still do not seem to be getting anywhere I am still getting the following error.

 

Parse error: syntax error, unexpected T_DOUBLE_ARROW in /home/pinktoys/public_html/catalog-dreamgirl/osc/includes/classes/order.php on line 56

 

Please help if you can, thank you!

 

Louise

Highvisualproducts

Link to comment
Share on other sites

  • 2 years later...

i am in the same problem not sure how to fix but i think i got an idea where the problem is

 

$this->info = array('currency' => $order['currency'],
'currency_value' => $order['currency_value'],
'payment_method' => $order['payment_method'],
'cc_type' => $order['cc_type'],
'cc_owner' => $order['cc_owner'],
'cc_number' => $order['cc_number'],
'cc_expires' => $order['cc_expires'],
'date_purchased' => $order['date_purchased'],
'orders_status' => $order_status['orders_status_name'],
'last_modified' => $order['last_modified'],
'total' => strip_tags($order_total['text']), //() seems extra
<!-- it should look like --> 'total' => strip_tags($order_total['text'],
'shipping_method' => ((substr($shipping_method['title'], -1) == ':') ? substr(strip_tags($shipping_method['title']), 0, -1) : strip_tags($shipping_method['title'])));

so we should try make our additional code a part of $this->info = array

lets try

Link to comment
Share on other sites

yes got it working

 

find bellow block and replace with bellow code

<?php
$this->info = array('currency' => $order['currency'],
'currency_value' => $order['currency_value'],
'payment_method' => $order['payment_method'],
'cc_type' => $order['cc_type'],
'cc_owner' => $order['cc_owner'],
'cc_number' => $order['cc_number'],
'cc_expires' => $order['cc_expires'],
'date_purchased' => $order['date_purchased'],
'orders_status' => $order_status['orders_status_name'],
'last_modified' => $order['last_modified'],
'total' => strip_tags($order_total['text']),
'shipping_method' => ((substr($shipping_method['title'], -1) == ':') ? substr(strip_tags($shipping_method['title']), 0, -1) : strip_tags($shipping_method['title']))); //or try , instead of ;

?>

 

in your case

'total' => strip_tags($order_total['text']),

) was missing

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...