0
votes

I am trying to add a thumbnail image of the uploaded file on a product option. Essentially, I have looked around stackoverflow and found the following page:

Opencart - Customer uploads different files to one product with different responses from the site

However, I keep getting the error: Parse error: syntax error, unexpected '<<' (T_SL) in /var/sites/s/sortedgifts.com/public_html/vqmod/vqcache/vq2-catalog_view_theme_journal2_template_product_product.tpl on line 757

when I follow the steps within that page. On line 757 I have put:

if ($option['product_option_id'] == IMAGE OPTION ID) {

I am thinking that the IMAGE OPTION ID is what needs to be edited but I have little knowledge of php and no idea what it is referencing here, I would be grateful if someone can help me out.

Thanks!

1
On line 757 you have a code if ($option['product_option_id'] == IMAGE OPTION ID) { literally? Like, literally IMAGE OPTION ID? And is it really from this file: /var/sites/s/sortedgifts.com/public_html/vqmod/vqcache/vq2-catalog_view_theme_journal2_template_product_product.tplshadyyx

1 Answers

0
votes

The error you're describing happens when you have heredoc code. You must ensure that the closing identifier is on its own line with no other characters in front of it, including spaces or tabs.

So, look for a line like this:

$var = <<<ASDF (with the three <'s)

Somewhere below it you'll find a line with ASDF; on it (or whatever it was that came after the three <'s). Make sure it's on its own line and remove anything in front of it.

It's unclear which file this problem might be in. There's no point editing the file in the error as it will be overwritten. I'd check any files you've recently added to /vqmod/xml/ first, and then look at /catalog/view/theme/journal2/template/product/product.tpl

PHP heredoc reference