Prestashop customers groups - php

Prestashop 1.7.5.2
I have a group of customers in particular (the 43). For this group of customers, I would like that from the "my account" section, there is a link that directs to a list of specific products to add to the basket and only these products (which I will select by id I imagine ).
This option should only be available for customer group 43.
I really have no idea how to do it.
Do you have any ideas I could explore?
Thanks a lot
A list of specific product for a specific customers group to add to the basket

You'll need to restrict your customer group to access a single category to which you will need to link the products you intend to offer.
Then you'll need to develop a simple module hooked into the customer display account hook to display a link to that category, if customer belongs to that ID group.
If you are not familiar with Prestashop and module development there are a few concepts you will have to learn, you can start here

Related

CS Cart Specific price per user group

Is it possible to add second price to each product and use that price if user in specific usergroup?
I was thinking doing that by adding another column to the product price table and then take advantage of the promotion function to somehow use that price instead of the usual discount you can set from admin.
Any pointers or ideas would be great, thank you.
Yes, it is possible to define price for product that is valid/shown only for users in specific usergroup.
To achieve this you need to use Quantity discounts tab on Editing product page.
Name of this tab implies as there must be some large amount of items bought (like volume discounts...), but quantity can also be just 1 item.
For this you first need to define usergroup (Customers->User groups).
Example is shown also on CS-Cart Knowledge base: Wholesale Prices
Best regards,
Bostjan
It is default CS-Cart feature. Please check the following article in the database:
http://kb.cs-cart.com/wholesale-prices

Different discount to different customers in magento

I am working on a B2B Magento based project where my client needs a specific functionality. He needs to set different discount to the different customer (suppose that a product is of $100 so he can able to give discount of 5% to the one customer, 12% to the 2nd, 12.5% to the 3rd one and so on...).
How can I achieve the same? Hope you got my point.
Maybe you can use group prices. You can create customer groups, assign your customers and you can define different prices for different groups in "Prices" tab of product details.
Hope this helps.
Try to apply the coupon. The coupon can be applied before checkout and you can automatically create the coupon after the 1st/2nd/3rd/4th/... sales of product.
for reference:
Shopping Cart Rules with Custom Condition?
You can use promotions at the group level.
Copied from: https://www.siteground.com/kb/set_custom_group_of_users_that_use_a_discount_in_magento/
You can add a new customer's group through the Magento administrative area -> Customers -> Customer Groups -> Add New Customer Group.
You can set the discount for the newly created group through the Magento administrative area -> Promotions -> Catalog Price Rules -> Add New Rule. At the creation page using the Customer Groups fields you can select the customers’ groups for which the promotion will be valid. Enter the other details, set the rule’s actions and conditions. At the end click on the Save Rule button.
Once a customer is registered you can change his/her group through the Magento administrative area -> Customers -> Manage Customers. Click on the Edit link besides the customer and change its group through Account Information -> Customer Group. When you are ready click on the Save Customer button.

Is there a way to have different guest customer groups, switchable through UI?

I want guests of my Magento shop to be able to switch between two simple states:
full price of products (group Guest1)
prices without tax, maybe some special prices (group Guest2)
Is it possible to have some dropdown in the shop to switch between the two groups, without being logged in?
The order will later be checked whether the prices of Guest2 apply to the customer, but I would like to show them beforehand, what the prices would look like.
Thanks!
By default, Magento uses the NOT_LOGGED_IN customer group, which is a constant in the code.
To change the constant, change the line 418 in app/code/Mage/Tax/Model/Calculation.php from
$customerTaxClass = Mage::getModel('customer/group')->getTaxClassId(Mage_Customer_Model_Group::NOT_LOGGED_IN_ID);
to
$customerTaxClass = Mage::getModel('customer/group')->getTaxClassId(Mage::getSingleton('customer/session')->getCustomerGroupId());
Now anywhere in the code, the customer group of the not logged in user can be changed with the following code:
if(!Mage::getSingleton( 'customer/session' )->isLoggedIn())
Mage::getSingleton('customer/session')->setCustomerGroupId(2);

Magento use final_price in a php script

Question regarding Magento:
I need to make a PHP script where I grab the ‘final_price’ (the price after applying category and shopping cart price rules), of a product for a particular customer group, and use this in a calculation to populate a specific attribute with the outcome.
Example:
Product ‘X’ has a ‘price’ attribute set at $100 in Magento
After applying the category price rules for customer group ‘CG’, the final_price for product ‘X’ for this specific customer group is $10
Next, I populate the (self-created) attribute ‘price grabbed’ = (final_price for product group CG) * ( 1.56 ) = $15.60
The script needs to make the above calculation for each of the products
I have been searching all over the place how to use final_price for a specific customer group in a PHP script in Magento CE 1.7.2, but can’t find a proper method. The idea is to call the script nightly through cron.
I have full access to Magento, the dedicated (Centos 5, LAMP) server, and all databases. The database has 15000 products.
Does anybody have an idea how I best do this?
Regards,
Jan
What is used in the product to determine the customer group is
Mage::getSingleton('customer/session')->getCustomerGroupId();
So what you want to do is to ensure that you set the customer group id in the customer session before calling the getFinalPrice() method on the catalog/product model.

Auto switch customer group in magento

Has anyone found a way to auto switch a customer group based on specific rules? For example, if a customer over their lifetime has ordered 200 plus bottles of something they are grouped in a specific customer tier and get special pricing (wholesale type situation)
I know how to do segments of customers but that doesn't help me auto change which customer group they belong too.
Thanks in advance for any help in the right direction...
there are a couple of payable extensions at magento connect or you can create simple module with custom actions. Article for a good start.
In case someone is still looking for an answer, this extension (which I created) can do exactly what you are looking for and more out of the box:
Website:
https://plugin.company/magento-extensions/automatic-customer-group-switching.html
On Magento Connect:
http://www.magentocommerce.com/magento-connect/automatic-customer-group-switching-by-plugin-company.html
If you'd like to build your own custom functionality though, I'd recommend looking into the sales_order_placed_after event and getting the order history details by filtering an order collection on the customer ID that has placed the order.
Mage::getModel('sales/order')->getCollection()->addFieldToFilter('customer_id', $yourCustomerId);
You can then loop through each order and get all items by using the getAllItemsmethod.
Alternatively you could retrieve a sales_order_item collection, and join the corresponding order details from the sales_flat_order table. Then you could filter on customer ID and product ID and group the results on product ID.
You can then base your customer group switching logic on the sum of the total ordered product quantity.

Categories