bgc42169 Posted May 8, 2009 Posted May 8, 2009 I currently using Margin Reports 3.0a and working well but i need help integrating ATTRIBUTES cost on dfferent Items that have these options for the products i sell. If i can be guided in the right direction i can probably do it my self, just not a PHP programmer by trade. Quote
steve_s Posted May 9, 2009 Posted May 9, 2009 (edited) I currently using Margin Reports 3.0a and working well but i need help integrating ATTRIBUTES cost on dfferent Items that have these options for the products i sell. If i can be guided in the right direction i can probably do it my self, just not a PHP programmer by trade. I think your using same one as me try in catalog/includes/classes/shopping_cart.php find $products_cost = $product['products_cost']; change to $products_cost = $product['products_cost'] + $value; Edited May 9, 2009 by steve_s Quote
bgc42169 Posted May 11, 2009 Author Posted May 11, 2009 I think your using same one as me tryin catalog/includes/classes/shopping_cart.php find $products_cost = $product['products_cost']; change to $products_cost = $product['products_cost'] + $value; Steve, Thanks, but dont you still need to have a database field for he added cost to the Attribute? Bruce Quote
bgc42169 Posted May 12, 2009 Author Posted May 12, 2009 Steve, Thanks, but dont you still need to have a database field for he added cost to the Attribute? Bruce Well, i have it saving the added cost of the Attribute to the database so admin\product_attributes.php admin\includes\languages\english\products_attributes.pho and database add attribute_cost to the database. Now i am having issues getting shopping cart and order.php to calculate the new item cost based on the new attribute Bruce Quote
bgc42169 Posted May 14, 2009 Author Posted May 14, 2009 Well, i have it saving the added cost of the Attribute to the database so admin\product_attributes.php admin\includes\languages\english\products_attributes.pho and database add attribute_cost to the database. Now i am having issues getting shopping cart and order.php to calculate the new item cost based on the new attribute Bruce Well i have update the database with the fields i need and added the code to the php i need to to calculate the final_costs for the attributes and original items. Now get an issue in the catalog/shopping_cart.php line 92 $attribute_values = tep_db_fetch_array($attributes); get error: Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/content/b/c/s/bcspadmin/html/includes/functions/database.php on line 99 Line 83 is redone to added one of my fields pa.options_values_cost, to the tep_db_query as the following: $attributes = tep_db_query("select popt.products_options_name, poval.products_options_values_name, pa.options_values_price, pa.options_values_cost, pa.price_prefix from " . TABLE_PRODUCTS_OPTIONS . " popt, " . TABLE_PRODUCTS_OPTIONS_VALUES . " poval, " . TABLE_PRODUCTS_ATTRIBUTES . " pa where pa.products_id = '" . $products[$i]['id'] . "' and pa.options_id = '" . $option . "' and pa.options_id = popt.products_options_id and pa.options_values_id = '" . $value . "' and pa.options_values_id = poval.products_options_values_id and popt.language_id = '" . $languages_id . "' and poval.language_id = '" . $languages_id . "'"); This field existed and is set in the admin/products_attributes.php Can anyone help me with this???????? Bruce Quote
bgc42169 Posted May 18, 2009 Author Posted May 18, 2009 I have everything updating everything for the product_cost and final_cost fields. I even fixed an issue I found with PAYPAL_IPN to make it compatible. Only issue now when the product_cost and final_cost fields move from Product_attributes to order_products database, i getting an additional $0.40 added to the order. Check and i am not adding any tax to the costs. Anyone have any Ideas???????? Bruce Well i have update the database with the fields i need and added the code to the php i need to to calculate the final_costs for the attributes and original items. Now get an issue in the catalog/shopping_cart.php line 92 $attribute_values = tep_db_fetch_array($attributes); get error: Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/content/b/c/s/bcspadmin/html/includes/functions/database.php on line 99 Line 83 is redone to added one of my fields pa.options_values_cost, to the tep_db_query as the following: $attributes = tep_db_query("select popt.products_options_name, poval.products_options_values_name, pa.options_values_price, pa.options_values_cost, pa.price_prefix from " . TABLE_PRODUCTS_OPTIONS . " popt, " . TABLE_PRODUCTS_OPTIONS_VALUES . " poval, " . TABLE_PRODUCTS_ATTRIBUTES . " pa where pa.products_id = '" . $products[$i]['id'] . "' and pa.options_id = '" . $option . "' and pa.options_id = popt.products_options_id and pa.options_values_id = '" . $value . "' and pa.options_values_id = poval.products_options_values_id and popt.language_id = '" . $languages_id . "' and poval.language_id = '" . $languages_id . "'"); This field existed and is set in the admin/products_attributes.php Can anyone help me with this???????? Bruce Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.