News:

You may pay someone to create your store, or you visit our seminar and become a professional yourself with the silver certification

Main Menu

Wholesale Shoppergroup Bulk upload pricing help

Started by aadilk4, October 31, 2013, 12:09:14 PM

Previous topic - Next topic

aadilk4

howsit everyone? so long time i havent been using virtuemart, i just got back into it now...

so ive got a site, and i have 1400+ products, of which i use CSVI to manage the pricing, now we have added wholesaler pricing, however i need to edit them in CSVI, as each product has a different pricing and not a %,

i have tried a few things but im not coming right at all!

please assist me with this!
thanking you!

sandstorm

I have set up my pricing and shoppergroups this exact way & it took me a few weeks to figure it all out.
First I tried setting up complex virtuemart calculations and rules, but in the end I opted for using shoppergroups & adding multiple prices to every product using CSVi

First of all you need to set up your extra shopper groups so that you end up with;

-default-  - when normal users are logged in
-anonymous-  - when anyone is looking at the store, not logged in
WHOLESALE  - your new shopper group where you will add your new prices

Make sure these are published and the checkbox for "Show following prices" is not ticked (this took me a while to figure out as I assumed that this would need to be ticked & caused me problems!)


[attachment cleanup by admin]
J3.6.4 / PHP7.0.12
VM3.0.16

sandstorm

It goes without saying really, that before you start messing about with bulk price uploads and any other sort of big Import files with CSVi, that you should ALWAYS backup first using Akeeba Backup Pro.
I always test anything with CSVi in a development site first, before running the imports in a live site.

I will assume that you are running Joomla 2.5.14, PHP5.3+, VM 2.0.24, & latest CSVi pro 5.8.15

In my initial setup, nearly all my product prices, showed up as "Show for all" in the product settings. This will not work if you are using shoppergroup prices, as when a wholesale customers are logged in they will have his special shoppergroup price allocated to him & also the "Show for all" price. and this will not work.

So 1st you have to delete all the existing prices in virtuemart (Now do you see why I like to work in a test site first :) ).
You can do this easily in CSVi in the backend - Components > CSVi > Maintenance, Select "Virtuemart" from dropdown 1 > Select "Remove product prices" from dropdown2 & click continue.

Now we are starting we a clean slate & we know there are no products with "Show all" set against there prices.
J3.6.4 / PHP7.0.12
VM3.0.16

sandstorm

You can also read the tutorial at CSVi here http://www.csvimproved.com/csvi-documentation/tutorials/909-product-price-import  & if your a paid subscriber, the support from roland at CSVi is excellent.

Next you are going to create a CSVi import template. So select Import > Virtuemart > Product_import  (Not Price Import) Save it first with a name something like "Product Price Import - ShopperGroups" - You have to save it first before you can add any fields to it.

Then set your file tab setting as follows (Again this works for me, you may be able to tweak a bit to suit);
Auto Detect Limiters : Yes
Use File Extension : Take from File
I'm Mac : No
Use Headers : Yes
Add Extra Fields: No
Skip 1st Line : No
Overwrite existing Data : YES
Skip New Items : YES
skip default value : Yes
Collect Debug Info : Yes

The add these following fields;
"product_sku","shopper_group_name_price","product_price"

Once you have these set up (Make sure the ordering is correct) just check over the other tabs for options,image, limits, etc I dint change these but you can check there settings.
Then click save and we now have our import template ready.




[attachment cleanup by admin]
J3.6.4 / PHP7.0.12
VM3.0.16

sandstorm

Assuming you now have 3 shopper groups named;
-anonymous-
-default-
WHOLSALE

& you have your import template all set up & your backed up and preferably testing in a test site - not live


You now need to create your CSVi file to import 3 sets of prices for every product.
You have to have the -anonymous- price for public users, the -default- price for regular logged in shoppers & WHOLSALE for your new special prices.
so your -default- & -anonymous- prices will more than likely be the same price, unless you are offering special price for logged in users?

You will need to set up csv file and save as UTF8 - more info here http://www.csvimproved.com/csvi-documentation/tutorials/916-save-a-csv-file-as-utf-8
The CSV file should now look like this;

"product_sku","shopper_group_name_price","product_price"
"AB123","-default-","19.99"
"AB123","-anonymous-","19.99"
"AB123","WHOLESALE","14,75"


When you import this and view the AB123 product you should now see in virtuemart back end for this product, these 3 prices listed ONLY.
You can then test  it by viewing the product not logged in, view it logged in with a regular user & view it logged in as a wholesale user, you shoudl see the price change when logged in as wholesale.

If something doesnt work here, then go back and check your shoppergroups and all the step I listed, or maybe open a ticket with CSVi as maybe your server or some other setting may not work? 
This method works perfectly for me & it took me 2-3 weeks to figure it all our properly.


ALSO VERY IMPORTANT - If you used to import products with CSVi and maybe you added the title, description, image, price, etc. You can now NOT import in this same way, as when you do the price of the product is allocated to "Show for all".
When you import a product now, you have to also include the field "shopper_group_name_price" & maybe set this to -anonymous-
then when you have imported your new products then go and perform the second import of importing the prices.

Also even if you are not offering a WHOLESALE price for a specific product you will still  need to add a price, as otherwise no price will show when logged in as wholesale.
J3.6.4 / PHP7.0.12
VM3.0.16

AH

Do not delete all your prices that is slightly worrying advice!

Please don't import 3 separate prices for every product, you do not need to.

You should already have an "available for all price" that is used for all customers

You do not need a separate price for every product - only for those prices you wish to differentiate

Now create the import for product prices you wish to differentiate for the wholesale group.

If a product is the same price for all groups, do not import a separate price.



Regards
A

Joomla 4.4.5
php 8.1

aadilk4

i have a few categories that the prices are different for the standard store front and the wholesale r section,which is only available for wholesalers on the site...

now im confused...

sandstorm

My way works perfectly for me.

When I had prices that were set for "show for all", when logged in as wholesale, no prices showed up at all? It was one of the VM team that advised me to remove all prices and re-import the prices for default, anonymous & default.

My site has 2500+ plus products & I use stockable variants plugin on nearly all of them.
My way is the only way I could get it working perfectly as I wanted it to as described above.

As long as your confident that you are backed up correctly and have a good price import file there is no problem whatsoever in removing all the prices, & this will probably only need to be done once (The first time you do it!)

As advised above I could test all this in a copy of your site to make sure your happy with the process.
Maybe even try the idea from "Hutson" Maybe that will work for you? It didnt for me!

Thanks

Andy
J3.6.4 / PHP7.0.12
VM3.0.16

AH

Sandstorm

I was trying to help you and others when creating prices.
It is great when we try and help out others that may have similar setups and problems.
I noted in your CSVI walkthrough that you recommended store owners create a price for every shopper group when they are not required to do so

What I am recommending is that they create as few prices as possible to effectively manage their businsess.
I use CSVI for managing prices, but I do not create prices for every single product.

Example pricing structure:-


Product SKU "Available to all" Price Wholesale gold Wholesale silver
10110.00
10230.0010.0020.00
10340.0020.00

Based on such a pricing structure
Sku 101 - only one price required as everyone pays 10.00
Sku 102  - 3 prices required if Not silver or gold pay 30.00  - gold-pay 10.00  silver-pay 20.00
Sku - 103 - 2 prices required if Not gold everyone pays 40.00  gold-pay 20.00

If I need to differentiate a price in the future I can do that with ease. I would never delete all my prices and effectively take my store offline!

Quote
Please don't import 3 separate prices for every product, unless you really want to.

You should already have an "available for all price" that is used for all customers

You do not need a separate price for every product - only for those prices you wish to differentiate

Now create the import for product prices you wish to differentiate for the wholesale group.

If a product is the same price for all groups, do not import a separate price.


Adjusted admin view show multiple shopper group prices
As the Viewing multiple prices in the product admin list was a pain, I adjusted the product listing display in the admin section to show the prices I have configured for each shopper group. Note that there is a lot wrong with this code if you have more than one price per product per shopper group!

VM 2.0.24

Fix the bug that prevents the admin product view overrides working
administrator\components\com_virtuemart\views\product\view.html.php

//quorvia removed to allow template overides in product admin
            //$this->addTemplatePath(JPATH_COMPONENT_ADMINISTRATOR.DS.'views'.DS.'product'.DS.'tmpl');





Then create a product admin override:-

administrator\templates\bluestork\html\com_virtuemart\product\default.php

Old code

<!-- Product price -->
<td align="right" ><?php
if(isset($product->product_price_display)) {
echo $product->product_price_display;
} elseif(!empty($product->prices)) {
echo JText::_('COM_VIRTUEMART_MULTIPLE_PRICES');
} else {
echo JText::_('COM_VIRTUEMART_NO_PRICE_SET');
}
?>
</td>


Possible option

<!-- Product price -->
<td align="right" ><?php
if(isset($product->product_price_display)) {
echo $product->product_price_display;
} elseif(!empty($product->prices)) {
foreach ($product->prices as $key => $qValue){
// differentiate the prices by groups 
                            
$group $qValue['virtuemart_shoppergroup_id'];
// do something different for shopper group price
                            
switch ($group){
                                case 
"4":
// wrap in a lovely div for styling purposes 
                                    
echo "<div class='adminprice gold'>";
                                    break;
                                case 
"5":
                                    echo 
"<div class='adminprice silver'>";
                                    break;
                                default:
                                    echo 
"<div class='adminprice'>";
                            }
// format the number for a shopper group price
                            
echo number_format($qValue['product_price'],2,'.','');
                            echo 
"</div>";
                        }


} else {
echo JText::_('COM_VIRTUEMART_NO_PRICE_SET');
}
?>
</td>









[attachment cleanup by admin]
Regards
A

Joomla 4.4.5
php 8.1

aadilk4

can i do it without removing all prices as i have too many prices to remove all and go on as the site is already live and i have continuous traffic?

Maxim Pishnyak

You can support Community by voting for Project on the JED
https://extensions.joomla.org/extension/virtuemart/#reviews
Join us at
https://twitter.com/virtuemart

AH

I already said you do not have to remove all old prices - read my post!
Regards
A

Joomla 4.4.5
php 8.1

Maxim Pishnyak

BTW, Hutson, Sandstorm has an interesting carma in researching Shoppergroup Price Import. You could check his previous threads/posts.
You can support Community by voting for Project on the JED
https://extensions.joomla.org/extension/virtuemart/#reviews
Join us at
https://twitter.com/virtuemart