Hey MC
I'm in the process of starting again. I have followed steps 1 to 6 and there are no errors. About to finish with 7 and 8 so we will see what happens before looking at the link :)
Printable View
Hey MC
I'm in the process of starting again. I have followed steps 1 to 6 and there are no errors. About to finish with 7 and 8 so we will see what happens before looking at the link :)
Ok, step 7 which reads ...
At this point when I click a product I get the outer page displaying but the centre of the page where the product and info site I ts just white with the words WARNING: An Error occurred, please refresh the page and try again.Quote:
edit 'main_template_vars.php' (in /includes/modules/pages/product_info/)
around line 46 you find the variable $sql set. like in step 3.2 add the new rows with a 'p.' in front just before the 'from'
select ......., p.products_guarantee, p.products_color from ....
Could you clarify, the field in my database is called ink_ml and the file I`m asked to edit looks like this ...
$sql = "select p.products_id, pd.products_name,
pd.products_description, p.products_model,
p.products_quantity, p.products_image,
pd.products_url, p.products_price,
p.products_tax_class_id, p.products_date_added,
p.products_date_available, p.manufacturers_id, p.products_quantity,
p.products_weight, p.products_priced_by_attribute, p.product_is_free,
p.products_qty_box_status,
p.products_quantity_order_max,
p.products_discount_type, p.products_discount_type_from, p.products_sort_order, p.products_price_sorter
from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd
where p.products_status = '1'
and p.products_id = '" . (int)$_GET['products_id'] . "'
and pd.products_id = p.products_id
and pd.language_id = '" . (int)$_SESSION['languages_id'] . "'";
I have tried variations of the instruction and get the error each time ??
And how does it look with your edit when you follow the provided instruction?
Again also, the link provided would guide you to error logs where the issue is likely described.
As soon as I edit the main_template_vars.php I refresh my store, click on a product and then get the error. I will follow the link you provided to see if it can shed some light, just wanted to check I had put the code in right as its a little confusing instruction 7 to a newbie :(
Okay, after the edit I look at the log file as advised by the link you sent and this was the log, way above my head if I`m being honest ...
[29-Aug-2017 00:21:29 Europe/London] Request URI: /index.php?main_page=product_info&cPath=1_7&products_id=77556, IP address: 86.164.234.122
#1 trigger_error() called at [/home/mcsbrid/public_html/ukinks.co.uk/includes/classes/db/mysql/query_factory.php:167]
#2 queryFactory->show_error() called at [/home/mcsbrid/public_html/ukinks.co.uk/includes/classes/db/mysql/query_factory.php:139]
#3 queryFactory->set_error() called at [/home/mcsbrid/public_html/ukinks.co.uk/includes/classes/db/mysql/query_factory.php:266]
#4 queryFactory->Execute() called at [/home/mcsbrid/public_html/ukinks.co.uk/includes/modules/pages/product_info/main_template_vars.php:58]
#5 require(/home/mcsbrid/public_html/ukinks.co.uk/includes/modules/pages/product_info/main_template_vars.php) called at [/home/mcsbrid/public_html/ukinks.co.uk/includes/templates/responsive_sheffield_blue/common/tpl_main_page.php:251]
#6 require(/home/mcsbrid/public_html/ukinks.co.uk/includes/templates/responsive_sheffield_blue/common/tpl_main_page.php) called at [/home/mcsbrid/public_html/ukinks.co.uk/index.php:97]
[29-Aug-2017 00:21:29 Europe/London] PHP Fatal error: 1064:You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.ink_ml,
from products p, products_description pd
where ' at line 11 :: select p.products_id, pd.products_name,
pd.products_description, p.products_model,
p.products_quantity, p.products_image,
pd.products_url, p.products_price,
p.products_tax_class_id, p.products_date_added,
p.products_date_available, p.manufacturers_id, p.products_quantity,
p.products_weight, p.products_priced_by_attribute, p.product_is_free,
p.products_qty_box_status,
p.products_quantity_order_max,
p.products_discount_type, p.products_discount_type_from, p.products_sort_order, p.products_price_sorter
p.ink_ml,
from products p, products_description pd
where p.products_status = '1'
and p.products_id = '77556'
and pd.products_id = p.products_id
and pd.language_id = '1' ==> (as called by) /home/mcsbrid/public_html/ukinks.co.uk/includes/modules/pages/product_info/main_template_vars.php on line 58 <== in /home/mcsbrid/public_html/ukinks.co.uk/includes/classes/db/mysql/query_factory.php on line 167
Without sounding thick are you saying to do this ..
,p.ink_ml
Or are you saying put a comma at the end of the previous line like so ..
p.products_discount_type, p.products_discount_type_from, p.products_sort_order, p.products_price_sorter,
So the coding should be as follows ..
$sql = "select p.products_id, pd.products_name,
pd.products_description, p.products_model,
p.products_quantity, p.products_image,
pd.products_url, p.products_price,
p.products_tax_class_id, p.products_date_added,
p.products_date_available, p.manufacturers_id, p.products_quantity,
p.products_weight, p.products_priced_by_attribute, p.product_is_free,
p.products_qty_box_status,
p.products_quantity_order_max,
p.products_discount_type, p.products_discount_type_from, p.products_sort_order, p.products_price_sorter
,p.ink_ml
from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd
where p.products_status = '1'
and p.products_id = '" . (int)$_GET['products_id'] . "'
and pd.products_id = p.products_id
and pd.language_id = '" . (int)$_SESSION['languages_id'] . "'";
Or
$sql = "select p.products_id, pd.products_name,
pd.products_description, p.products_model,
p.products_quantity, p.products_image,
pd.products_url, p.products_price,
p.products_tax_class_id, p.products_date_added,
p.products_date_available, p.manufacturers_id, p.products_quantity,
p.products_weight, p.products_priced_by_attribute, p.product_is_free,
p.products_qty_box_status,
p.products_quantity_order_max,
p.products_discount_type, p.products_discount_type_from, p.products_sort_order, p.products_price_sorter,
p.ink_ml
from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd
where p.products_status = '1'
and p.products_id = '" . (int)$_GET['products_id'] . "'
and pd.products_id = p.products_id
and pd.language_id = '" . (int)$_SESSION['languages_id'] . "'";
Not thick. It's just clear that the construct of a select statement is unfamiliar.
Technically it doesn't matter which way; however, when the next upgrade is performed and if you use comparison software, it would be clearer what the change/difference is/was if all new information is on the same line rather than split among two of them. Meaning, I would suggest your first representation:
, p.ink_ml
MC yet again a great help, doing the change has stopped the error, final part is this, I have placed the final code here in step 7 but the data is not showing.
<!--bof Product details list -->
<?php if ( (($flag_show_product_info_model == 1 and $products_model != '') or ($flag_show_product_info_weight == 1 and $products_weight !=0) or ($flag_show_product_info_quantity == 1) or ($flag_show_product_info_manufacturer == 1 and !empty($manufacturers_name))) ) { ?>
<ul id="productDetailsList" class="floatingBox back">
<?php echo (($flag_show_product_info_model == 1 and $products_model !='') ? '<li>' . TEXT_PRODUCT_MODEL . $products_model . '</li>' : '') . "\n"; ?>
<?php echo (($flag_show_product_info_weight == 1 and $products_weight !=0) ? '<li>' . TEXT_PRODUCT_WEIGHT . $products_weight . TEXT_PRODUCT_WEIGHT_UNIT . '</li>' : '') . "\n"; ?>
<?php echo $product_info->fields['ink_ml']; ?>
<?php echo (($flag_show_product_info_quantity == 1) ? '<li>' . $products_quantity . TEXT_PRODUCT_QUANTITY . '</li>' : '') . "\n"; ?>
<?php echo (($flag_show_product_info_manufacturer == 1 and !empty($manufacturers_name)) ? '<li>' . TEXT_PRODUCT_MANUFACTURER . $manufacturers_name . '</li>' : '') . "\n"; ?>
</ul>
<br class="clearBoth" />
<?php
}
?>
Have I placed it in the correct area or is it something more sinister ?
Yet the field is there in admin when I edit a product