Zen Cart Logo
If this is your first visit, check our documentation. To post, register or login.
Forums / Community Contributed Add-Ons / All Other Contributions/Addons / Updating price from products_purchase_price and products_margin in quick_updates-v2.0

Updating price from products_purchase_price and products_margin in quick_updates-v2.0

Locked
This thread is locked. New replies are disabled.
21 Jul 2009, 4:55 AM
#1
g_nencini avatar

g_nencini

Zen Follower

Join Date:
Mar 2006
Location:
Florence, Italy
Posts:
153
Plugin Contributions:
0

Post #1 by g_nencini

I've posted this thread also in the section "All Other Contributions/Addons - Quick Updates 1.3 ?... but seems (from the date of the post) that nobody is still interested to this add-on, so excuse me if I copy here!!!

In quick_updates-v2.04 I've modified in admin/includes/extra_configures/quick_updates.php
define('QUICKUPDATES_MODIFY_PURCHASE_AND_MARGIN', 'true');
an now I can define for each product the products_purchase_price and the products_margin.

Now I want that the price to be calculated and updated from theese values: before to become crazy modifying the code, is somewhere the possibility fo setting this easily?

Thanks - Giovanni

22 Jul 2009, 4:43 AM
#2
g_nencini avatar

g_nencini

Zen Follower

Join Date:
Mar 2006
Location:
Florence, Italy
Posts:
153
Plugin Contributions:
0

Post #2 by g_nencini

Nobody????
I really must become crazy???
Giovanni

23 Jul 2009, 3:15 AM
#3
g_nencini avatar

g_nencini

Zen Follower

Join Date:
Mar 2006
Location:
Florence, Italy
Posts:
153
Plugin Contributions:
0

Post #3 by g_nencini

Well, here is the module modified for the features I needed.
Read the readme_modified.txt

Giovanni

23 Jul 2009, 8:11 AM
#4
bruce1952 avatar

bruce1952

Totally Zenned

Join Date:
Aug 2008
Location:
Sydney Australia
Posts:
828
Plugin Contributions:
0

Post #4 by bruce1952

g.nencini:

Well, here is the module modified for the features I needed.
Read the readme_modified.txt

Giovanni

Got this error after installing the quick_update.sql :

1054 Unknown column 'p.products_purchase_price' in 'field list'
in:
[select p.products_id, p.products_type, p.products_image, p.products_purchase_price, p.products_margin, p.products_model, pd.products_name, p.products_status, p.products_weight, p.products_quantity, p.manufacturers_id, p.products_price, p.products_tax_class_id, p.products_date_added, p.products_last_modified, p.products_date_available, p.products_quantity_order_min, p.products_quantity_order_units, p.products_priced_by_attribute, p.product_is_free, p.product_is_call, p.products_quantity_mixed, p.product_is_always_free_shipping, pd.products_description, p.products_quantity_order_max, p.products_sort_order, p.master_categories_id, m.manufacturers_name, p2c.categories_id from products p LEFT JOIN products_description pd ON (p.products_id = pd.products_id and pd.language_id = '1') LEFT JOIN manufacturers m ON (p.manufacturers_id = m.manufacturers_id) LEFT JOIN products_to_categories p2c ON (p.products_id = p2c.products_id) order by p.products_id DESC limit 0, 20]
If you were entering information, press the BACK button in your browser and re-check the information you had entered to be sure you left no blank fields.

Outdoorking
Live Site https://www.outdoorking.com.au

24 Jul 2009, 2:05 PM
#5
g_nencini avatar

g_nencini

Zen Follower

Join Date:
Mar 2006
Location:
Florence, Italy
Posts:
153
Plugin Contributions:
0

Post #5 by g_nencini

Read better the readme.txt:
you must add the two fields "products_purchase_price" and "products_margin" to the "products table". I use always phpmyadmin.

Giovanni

24 Jul 2009, 3:23 PM
#6
g_nencini avatar

g_nencini

Zen Follower

Join Date:
Mar 2006
Location:
Florence, Italy
Posts:
153
Plugin Contributions:
0

Post #6 by g_nencini

I've forgotten......
Set the new fields NOT NULL and predefined value = 0

Giovanni

25 Jul 2009, 9:57 AM
#7
g_nencini avatar

g_nencini

Zen Follower

Join Date:
Mar 2006
Location:
Florence, Italy
Posts:
153
Plugin Contributions:
0

Post #7 by g_nencini

You can also use the sql patch

ALTER TABLE products ADD products_purchase_price DECIMAL(15,4) DEFAULT '0' NOT NULL ;
ALTER TABLE products ADD products_margin DECIMAL(15,2) DEFAULT '0' NOT NULL ;

Giovanni

26 Jul 2009, 12:33 PM
#8
bruce1952 avatar

bruce1952

Totally Zenned

Join Date:
Aug 2008
Location:
Sydney Australia
Posts:
828
Plugin Contributions:
0

Post #8 by bruce1952

g.nencini where do I get the patch file from?

Outdoorking
Live Site https://www.outdoorking.com.au

26 Jul 2009, 3:44 PM
#9
g_nencini avatar

g_nencini

Zen Follower

Join Date:
Mar 2006
Location:
Florence, Italy
Posts:
153
Plugin Contributions:
0

Post #9 by g_nencini

copy the two statements above.
open admin->tools->install sql patches
paste the two statement in the text area
click the send button

I use alwais phpMyadmin

Giovanni

26 Jul 2009, 10:17 PM
#10
petje007 avatar

petje007

New Zenner

Join Date:
Dec 2008
Location:
Amsterdam, The Netherlands
Posts:
21
Plugin Contributions:
0

Post #10 by petje007

Hello Giovanni,

This is a very usefull add-on for me, thanks for your work!
It is now for me very easy and fast to change records from the database.

Thanks again!

27 Jul 2009, 4:12 AM
#11
lankeeyankee avatar

lankeeyankee

Totally Zenned

Join Date:
Jan 2007
Posts:
1,514
Plugin Contributions:
1

Post #11 by lankeeyankee

Thanks for this!


Zen Cart and it's community are the best!!

31 Aug 2009, 12:32 PM
#12
giuly avatar

giuly

Zen Follower

Join Date:
May 2007
Location:
Italy
Posts:
438
Plugin Contributions:
0

Post #12 by giuly

hello giovanni, can I ask you something?
I have to add a field in quick update, minimum quantity.
Can you help me on how can I do?

I am italian, so if you want we can speak italian on pm
Ciao