Page 26 of 28 FirstFirst ... 162425262728 LastLast
Results 251 to 260 of 272
  1. #251
    Join Date
    Aug 2013
    Location
    Bridlington
    Posts
    151
    Plugin Contributions
    0

    Default Re: How-To: Add new Properties to your Products

    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 :)

  2. #252
    Join Date
    Aug 2013
    Location
    Bridlington
    Posts
    151
    Plugin Contributions
    0

    Default Re: How-To: Add new Properties to your Products

    Ok, step 7 which reads ...

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

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

  3. #253
    Join Date
    Jul 2012
    Posts
    16,733
    Plugin Contributions
    17

    Default Re: How-To: Add new Properties to your Products

    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.
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  4. #254
    Join Date
    Aug 2013
    Location
    Bridlington
    Posts
    151
    Plugin Contributions
    0

    Default Re: How-To: Add new Properties to your Products

    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

  5. #255
    Join Date
    Aug 2013
    Location
    Bridlington
    Posts
    151
    Plugin Contributions
    0

    Default Re: How-To: Add new Properties to your Products

    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

  6. #256
    Join Date
    Jul 2012
    Posts
    16,733
    Plugin Contributions
    17

    Default Re: How-To: Add new Properties to your Products

    Quote Originally Posted by MCS_Computers View Post
    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
    Remove the comma after p.ink_ml and put one before it.

    The comma there represents that another field is to follow. There isn't one, so the database engine isn't sure what to do and errors...
    Last edited by mc12345678; 29 Aug 2017 at 12:56 AM.
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  7. #257
    Join Date
    Aug 2013
    Location
    Bridlington
    Posts
    151
    Plugin Contributions
    0

    Default Re: How-To: Add new Properties to your Products

    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'] . "'";

  8. #258
    Join Date
    Jul 2012
    Posts
    16,733
    Plugin Contributions
    17

    Default Re: How-To: Add new Properties to your Products

    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
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  9. #259
    Join Date
    Aug 2013
    Location
    Bridlington
    Posts
    151
    Plugin Contributions
    0

    Default Re: How-To: Add new Properties to your Products

    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 ?

  10. #260
    Join Date
    Aug 2013
    Location
    Bridlington
    Posts
    151
    Plugin Contributions
    0

    Default Re: How-To: Add new Properties to your Products

    Yet the field is there in admin when I edit a product

 

 
Page 26 of 28 FirstFirst ... 162425262728 LastLast

Similar Threads

  1. change how latest products works or add new box that displays products we select
    By Sushigal in forum Templates, Stylesheets, Page Layout
    Replies: 6
    Last Post: 12 Oct 2010, 04:19 PM
  2. shopping cart contents and new properties to the products
    By stitchnkitty in forum Templates, Stylesheets, Page Layout
    Replies: 0
    Last Post: 10 Nov 2009, 05:50 PM
  3. Replies: 4
    Last Post: 20 Jun 2009, 04:06 PM
  4. !! Please help !! Add new Properties to your Products
    By JohnSquier in forum Setting Up Categories, Products, Attributes
    Replies: 4
    Last Post: 27 Feb 2008, 05:46 AM
  5. alter and add new product properties
    By jmitton in forum Setting Up Categories, Products, Attributes
    Replies: 3
    Last Post: 20 Jan 2008, 03:24 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR