Author Topic: when I create product and save it does not save the price  (Read 7993 times)

titus1972

  • Beginner
  • *
  • Posts: 4
when I create product and save it does not save the price
« on: December 20, 2009, 03:49:18 am »
It is only after I go in and edit the product again and re-save does it retain the price info as it is saving it eventually what could it be?

javierb

  • Beginner
  • *
  • Posts: 1
Re: when I create product and save it does not save the price
« Reply #1 on: January 23, 2010, 00:45:30 am »
I'm having the same problem. I have to go back and re-enter the price and then it will save. However, if I go back into that item and change something like the description and hit save the price will go back to 0, unless I re-enter the price before I save it. It can never remember the price. How can I fix this?

walter07

  • Beginner
  • *
  • Posts: 13
Re: when I create product and save it does not save the price
« Reply #2 on: January 25, 2010, 06:58:48 am »
Hi Guys,
let me join the club!
I have exactly the same problem as you have described, new products do not keep the price until I enter it a second time and save it again.

It all started after I moved Joomla 1.5.15 and VM 1.1.4 from a subdomain to the home directory by ftp.
All worked fine until I uploaded a new image and hit the save button.
All prices have disappeared instantly. Since then I have the problem with pricing and had to enter all my prices from all products again.
Products that were there before the move save the price on the first try.
New products need double saving.

Please post answers if you find any!

Thanks!

walter07

  • Beginner
  • *
  • Posts: 13
Re: when I create product and save it does not save the price
« Reply #3 on: February 04, 2010, 12:53:21 pm »
Check the following:
go to "list products", check the product item in the box to the right, click "list prices" on the top menue and it is very likely the prices will show there! Quite possibly you might have at least two prices there, depending on how often you have saved the product price. When you save your price the second time it saves it in a different shopper group to the one you have selected as default.
1.st save= price for original default shopper group (showing$00 if you have changed your default shopper group)( showing the correct price if you still have your original default shopper group)
2.nd save= price for selected default shopper group (visible if you have changed your default group)

Virtuemart seems to link the price of a new product to the original "default" shoper group in VM only .( sure this could be changed by editing the right code)
This is regardless of what shopper group you have choosen as default shopper group. If you have set your default shopper group different to the original default shopper group I recommend to switch it back to the original setting. You should then see the price the first time you save it! Also check the permissions you give to your frontend shoppers, they will only see the prices they have listed in their shopper group price list!
Admin users only seem to be able to see the "original" default shopper group prices unless you click on "list prices" in the eproduct list.
I sincerely hope this will help someone along the way, I had to find it out the hard way myself like a lot of other things in Virtuemart.I wish live was easier.
Good Luck!

stAn99

  • Contributing Developer
  • Jr. Member
  • *
  • Posts: 85
    • One Page Checkout for Virtuemart 2
Re: when I create product and save it does not save the price
« Reply #4 on: February 08, 2010, 00:04:55 am »
In file .... /html/product/product.product_form.php around line 156 in virtuemart 1.1.4 there is "when there is no default, take the first in database" and just before that, there is a search including db-f("vendor_id") in sql query which is not set when creating new product in virtuemart basic view. You can modify sql query and the code to the following:

// get the default shopper group
$shopper_db = new ps_DB;
// stAn this 2 lines were added and sql modified
$vendor_id = $db->f("vendor_id");
if (!isset($vendor_id)) $vendor_id = 1;
$q =  "SELECT shopper_group_id,shopper_group_name FROM #__{vm}_shopper_group WHERE `default`= '1' AND vendor_id='".$vendor_id."'";
$shopper_db->query($q);

// stAn took me about 3 hours to find out
----
RuposTel.com
www.rupostel.com
Your customized checkout solution for Virtuemart

kabhi_iitk

  • Beginner
  • *
  • Posts: 2
Re: when I create product and save it does not save the price
« Reply #5 on: April 20, 2010, 14:09:48 pm »
When I click on List Prices and add a new price and save, it actually changes the original price of product. This should not be happening. Please somebody show me some answer.

shv_rk

  • Jr. Member
  • **
  • Posts: 68
Re: when I create product and save it does not save the price
« Reply #6 on: April 23, 2010, 14:45:12 pm »
I am having the same problem Any solutions? :-\
I did what walter07 is recommend but didn't work for me

beachy

  • Jr. Member
  • **
  • Posts: 277
  • VirtueMart Version: 2.0.22
Re: when I create product and save it does not save the price
« Reply #7 on: April 24, 2010, 17:44:12 pm »
Hi I am having a similar problem but mine causes all changes not to be saved!

Please find details here http://forum.virtuemart.net/index.php?topic=69866.msg232257#msg232257

BTW I am running Joomla 1.5.16 and Virtuemart 1.1.4 on apache
_______
Joomla 2.5.11 Virtuemart 2.0.22
Apache 2.2.24 PHP 5.4.13
Hosted By RochenHost.com - MVS

shv_rk

  • Jr. Member
  • **
  • Posts: 68
Re: when I create product and save it does not save the price
« Reply #8 on: April 26, 2010, 12:42:35 pm »
No solutions yet  :'(

rb

  • Advanced
  • Full Member
  • *****
  • Posts: 1503
Re: when I create product and save it does not save the price
« Reply #9 on: April 27, 2010, 00:56:46 am »
shv_rk, one cause of this symptom is having more than 1 Vendor record.  Use phpMyAdmin to look at jos_vm_vendor.  You should have just 1 record with a vendor_id = 1.  If you have more than 1, or you don't have id 1, then it can cause this problem, as VirtueMart only supports 1 vendor.

If your vendor table is ok, then try this: turn on debug and enable logging, then add your price and see if debug or the log shows any error messages.

shv_rk

  • Jr. Member
  • **
  • Posts: 68
Re: when I create product and save it does not save the price
« Reply #10 on: April 27, 2010, 11:35:10 am »
@rb
Thanks for the reply, yes I have 3 vendors! but they are necessary for my website. What should I do then? is there anyway to fix it other than deleting vendors?

I have deleted vendor 1 from the admin panel, but I still have it in the database!! what should I do to bring it back?

btw: I am new in vm... how can I turn on debug?

rb

  • Advanced
  • Full Member
  • *****
  • Posts: 1503
Re: when I create product and save it does not save the price
« Reply #11 on: April 27, 2010, 15:56:39 pm »
Since your database has multiple vendors in it (not supported), your database is probably in an inconsistent state.  If it were my site, I would start over with a clean install.

shv_rk

  • Jr. Member
  • **
  • Posts: 68
Re: when I create product and save it does not save the price
« Reply #12 on: April 27, 2010, 16:02:03 pm »
thanks rb, I deleted other 2 vendors from the database and problem of not saving prices is solved.
however, I need to have multiple vendors!

I hope the next version of VM supports multiple vendors and will be released soon!

mattiadj

  • Beginner
  • *
  • Posts: 2
Re: when I create product and save it does not save the price
« Reply #13 on: October 12, 2010, 11:27:06 am »
Hello,
i have found the solution. Is tested on VM 1.1.5 but i thinks works on 1.1.4 also.

On file administrator\components\com_virtuemart\classes\ps_product.php
at line 1649 on function called get_retail_price
comment line
Code: [Select]
$q = "SELECT vendor_id FROM #__{vm}_product WHERE product_id='$product_id'";
$db->setQuery($q); $db->query();
$db->next_record();
$vendor_id = $db->f("vendor_id");
and change
Code: [Select]
$q = "SELECT shopper_group_id FROM #__{vm}_shopper_group WHERE `vendor_id`='$vendor_id' AND `default`='1'";to
Code: [Select]
$q = "SELECT shopper_group_id FROM #__{vm}_shopper_group WHERE `vendor_id`='1' AND `default`='1'";
That's all!
Now the price is correctly saved and the correct vendor is selected.
Enjoy