2 shops with different prices with the same productfile
I want one shop for private customers, and one shop for firms with a special contract with us. I want both shops to use tha same product file. No problem here. But I want to implement discount groups for the second shop. I have a login for the shop and want to be able to set a login user to for example 20% doscount group and another user to 30% discount group.
My initial thoughts are to just have a variable $discount that is 1.0 for regular customers and 0.8 for the ones that should have 20% discount. I want all prices to be shown with the discount in the shop.
And sort of do: price = discount * fetchPriceFromDatabase(aProduct) Is this possible and where should I put this code? Is the price fetched several times from the database?
Or maybe the discount could be implemented in the imaginary function fetchPriceFromDatabase(aProduct):
I've allmost found the solution: I added a line with the 0.8 multiplicaton: list( $aProducts['position'], $aProducts['name'], $aProducts['id'], $aProducts['category'], $aProducts['price'], $aProducts['shortDescription'], $aProducts['fullDescription'], $aProducts['status'] ) = $aData[$i]; $aProducts['price'] = $aProducts['price'] * 0.8;
This makes the price change everywhere exept in the overview of the products. The discount price is still used when you click on a priduct and when you buy the product in the shop. How can I change the price in the overview of the products? I'm using productsInRow plugin and also the taxAndDiscount plugin.
This change was made in core/products.php in function throwProduct