If this is your first visit, check our documentation. To post, register or login.

Baseprice = Grundpreis in ZenCart

Locked

Started by kai74 on 8 Jun 2006, 8:49 AM · Views: 7,287

Results 1 to 12 of 12
This thread is locked. New replies are disabled.
8 Jun 2006, 8:49 AM
#1
kai74 avatar

kai74

New Zenner

Join Date:
Jun 2006
Posts:
7
Plugin Contributions:
0

Baseprice = Grundpreis in ZenCart

Hello,

i´m german. so sorry for my ... english. :D

my problem:

in germany you have to put the baseprice-information (grundpreis)nearby the price-information if you have 1 bag 0,75kg = 5€, because there must by the information for 1 kg = x€.

but i can´t find this in the priceoptions.

i hope you understand my question. :D

how can i make it?

regards, kai

8 Jun 2006, 4:58 PM
#2
absolute avatar

absolute

Totally Zenned

Join Date:
May 2005
Location:
Bath, Somerset
Posts:
1,054
Plugin Contributions:
2

Re: Baseprice = Grundpreis in ZenCart

You need to alter the functions_prices.php files, fould in includes/functions.

You'll find the function zen_get_products_display_price, which returns the display price. I would suggest editting this function to display the price per wieght also.

You will need to add code before the line:

return $final_display_price . $free_tag . $call_tag;

I would get the products weight on a previous line, considering any attributes, and then calculate the price per 1kg. You can then add this onto the end of the price string which is returned.

Hope this helps. Let me know if I haven't explained it enough for you.

Absolute

Back, after a 4 year absence! Did you miss me?
Absolute Web Solutions Ltd
Interested in our work? Take a look at one of our sites - The Tech Store

8 Jun 2006, 7:04 PM
#3
kai74 avatar

kai74

New Zenner

Join Date:
Jun 2006
Posts:
7
Plugin Contributions:
0

Re: Baseprice = Grundpreis in ZenCart

many thanks for your answer.

but i´m not so good at php that i can mak it.

so i hope u could help me.

i have 2 sorts of produkts:

first sort is about pieces so there i don´t need the "grundprieis".

second sort ist about at example 0,75kg per bag. so in this sort i need the "grundpreis" nearby the normal price.

here is one example:

1 x cofe 0,5kg per bag = 5,00€ (1kg=10,00€)

i hope this are enough information to do this.

i´m very glad and happy that you wanna make it for me.

thanks a lot.

regards, kai.

8 Jun 2006, 7:46 PM
#4
absolute avatar

absolute

Totally Zenned

Join Date:
May 2005
Location:
Bath, Somerset
Posts:
1,054
Plugin Contributions:
2

Re: Baseprice = Grundpreis in ZenCart

I don't mind helping you to learn and create it for yourself. Lets see how you get on.

If I were you, I'd setup your products in two types. One type should be those that need the price per kg, and the other type those that just she the prices.

Next go to line 207, and add " products_type, prducts_weight, " after the word select.

On line 294, before the line starting "return $final_display_price.....", place

if ($product_check->fields['products_type'] == '1' && $product_check->fields['products_weight'] > 0) {
  $weight_price = '<br />' . (zen_get_products_actual_price($products_id) / $product_check->fields['products_weight']) . ' per Kg';
} else {
  $weight_price = '';
}

Finally, on line 295, after $call_tag, add " . $weight_price;"

I have included the product type in the IF statement. If you want to display the price per Kg for every product, then just remove this from the if statement.

Hope this helps

Absolute

Back, after a 4 year absence! Did you miss me?
Absolute Web Solutions Ltd
Interested in our work? Take a look at one of our sites - The Tech Store

8 Jun 2006, 9:15 PM
#5
kai74 avatar

kai74

New Zenner

Join Date:
Jun 2006
Posts:
7
Plugin Contributions:
0

Re: Baseprice = Grundpreis in ZenCart

thanks for this great idea.

the lines are not exactly the same. so i made mistakes, i think. cause i become an error-message:

1054 Unknown column 'prducts_weight' in 'field list'
in:
[select products_type, prducts_weight, products_tax_class_id, products_price, products_priced_by_attribute, product_is_free, product_is_call from zen_products where products_id = '1' limit 1]

i attached the "functions_prices.php" as a zip-file.

hopefully u can help an explain, what i made wrong.

thanks. kai

8 Jun 2006, 9:35 PM
#6
ckuhl avatar

ckuhl

New Zenner

Join Date:
May 2006
Posts:
24
Plugin Contributions:
0

Re: Baseprice = Grundpreis in ZenCart

Kai74:

thanks for this great idea.

the lines are not exactly the same. so i made mistakes, i think. cause i become an error-message:

i attached the "functions_prices.php" as a zip-file.

hopefully u can help an explain, what i made wrong.

thanks. kai

Unknown column 'prducts_weight' in 'field list'

Maybe change to 'products_weight' ?

ckuhl

8 Jun 2006, 9:45 PM
#7
kai74 avatar

kai74

New Zenner

Join Date:
Jun 2006
Posts:
7
Plugin Contributions:
0

Re: Baseprice = Grundpreis in ZenCart

thanks a lot. such simple mistake with big result. :blush:

i found the mistake a secound befor u post. :D

but now its not so beautyful, cause it should looks like: "€ 1,33 per Kg" and not
"1,333333333 per Kg" and it should be in small letters.

the "€" or "$" should print automaticly.

please help.

9 Jun 2006, 11:02 AM
#8
ckuhl avatar

ckuhl

New Zenner

Join Date:
May 2006
Posts:
24
Plugin Contributions:
0

Re: Baseprice = Grundpreis in ZenCart

Kai74:

thanks a lot. such simple mistake with big result. :blush:

i found the mistake a secound befor u post. :D

but now its not so beautyful, cause it should looks like: "€ 1,33 per Kg" and not
"1,333333333 per Kg" and it should be in small letters.

the "€" or "$" should print automaticly.

please help.

In the code that Absolute provided, change ' per Kg'; to 'per kg';

ckuhl

9 Jun 2006, 12:17 PM
#9
kai74 avatar

kai74

New Zenner

Join Date:
Jun 2006
Posts:
7
Plugin Contributions:
0

Re: Baseprice = Grundpreis in ZenCart

thanks.

but that ist not the answer for my question exactly.

the "grundpreis" has to be like this: 10,33
and NOT : 10,3 or 10,3333333

you know what i think? (i´m german. so sorry for my english again. :D )

and there ist a little mistake.

the normal price ist within tax but the "grundpreis" ist without.

if i chose in admin to display price with tax then the "grundpreis" also hast to be with tax.
if i chose to display without tax so the "grundpreis" hast also to be without tax.

please help me.

regards kai

9 Jun 2006, 2:20 PM
#10
absolute avatar

absolute

Totally Zenned

Join Date:
May 2005
Location:
Bath, Somerset
Posts:
1,054
Plugin Contributions:
2

Re: Baseprice = Grundpreis in ZenCart

You need to include a $currencies->format function to get the €xx.xx per Kg.

Try this:

if ($product_check->fields['products_type'] == '1' && $product_check->fields['products_weight'] > 0) {
  $weight_price = '<br />' . $currencies->format(zen_get_products_actual_price($products_id) / $product_check->fields['products_weight']) . ' per Kg';
} else {
  $weight_price = '';
}

That replaces the code in the previous post.

Again, I haven't tested it, but let me know if you have any problems.

Absolute

Back, after a 4 year absence! Did you miss me?
Absolute Web Solutions Ltd
Interested in our work? Take a look at one of our sites - The Tech Store

9 Jun 2006, 9:41 PM
#11
kai74 avatar

kai74

New Zenner

Join Date:
Jun 2006
Posts:
7
Plugin Contributions:
0

Re: Baseprice = Grundpreis in ZenCart

wow. that works fine!! :thumbsup:

but there is a little mistake.

if i choice (price within tax) in admin-panel then the normal price is calculate and displayed within tax but the "grundpreis" is displayed without tax.

please help again. i dont know how to do.

greets kai

12 Jun 2006, 12:45 PM
#12
kai74 avatar

kai74

New Zenner

Join Date:
Jun 2006
Posts:
7
Plugin Contributions:
0

Re: Baseprice = Grundpreis in ZenCart

please help me.

the shop has to start at 1. july. so it´s very important for me.

thanks a lot.

regards kai