Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

MARGIN REPORT 3.0A. Need Help integrating Attribute costs


Recommended Posts

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.

Link to comment
Share on other sites

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 by steve_s
Link to comment
Share on other sites

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;

 

 

Steve,

 

Thanks, but dont you still need to have a database field for he added cost to the Attribute?

 

Bruce

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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

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