How to add 2 buttons 'add to cart' getting with different data in Prestashop? - content-management-system

My product has 2 prices (discount price, old price). I want to add two buttons that add product with different price. How I can do it?

If you need to just show old/discounted price for a product use Specific Prices option in Prices tab of a prodct.
Or maybe you want to do that for a bunch of products.
The standard way to do that kind of things in Prestashop is by using price rules. In this case you may need to create a category like Sales/Offers. Assign all products you need to that category in their Association tab. Then go to Price Rules -> Catalog Price Rules + Add a new condition group (choose category here), create the price rule above based on your needs.

Related

Tableau - Filter View Based on Different Variable

Is there a way in Tableau to filter a view based on its relationship with a different variable?
For example, say I have a dataset with variables Company (values = A, B, C) and Product (values = 1, 2, 3). In one view, I want to select a Product. In the other view, I want to filter to only Companies that have that Product, but I want to show all Products for those companies. The typical filtering approach in Tableau could easily show me which Companies have that Product, but the rows with other Products from the same Companies would be excluded by the filter.
Any solutions? I get the feeling I may be missing something simple.
Create a parameter to represent the product of interest. You can load the values of the parameter from the Product field, but will have to add/remove choices periodically as product list changes.
Place Company on the filter shelf, and use the condition tab to choose only companies that have that Product with a formula such as max(Product = [Product of Interest])
For more than one product at a time, create a set of Products instead of a parameter and change the formula to test for set membership instead of field equality. If you have a set of Products called [Products of Interest], note the plural, the formula is then simply max([Products of Interest])
The nice part about a set is that it notices changes to the database Products list automatically. The bad part about a set is that Tableau doesn't make it easy to add or remove elements from a set in the user interface unless you are using Tableau Desktop (at least not by version 10.1)
In addition to the methods explained by Alex, (if you are okay with having multiple sheets) you can have 2 sheets linked with an Action filter -
First sheet would just show the unique list of Products (this acts as the Source sheet)
Second source would contain whatever view you like to show with Companies and their products (this acts as the destination sheet)
Create an action filter between the 2 sheets and use the "Selected fields" under Target filters to filter using the Company field. This way, if you select any specific product(s) in the first sheet, all relevant companies would be filtered in the second sheet but all the products show up too!
EDIT: this is a good solution in many cases, but there are a few things to be careful about.
Note that the first sheet needs Company on some shelf, possible detail, so that field is available for the filter action. If there can be multiple companies per product, then that can complicate the viz a bit.

Showing comparison across groups in tooltip Tableau

I have a dashboard that lets users compare a company selected from a drop down menu (Company A) to another company chosen from another drop down menu (Company B). This then displays stacked bar charts (5 categories) by year. I want to build a tooltip so that when the user hovers over one of the 5 categories in either set of bar charts, it shows a comparison of that category between Company A and Company B. Is this possible, and if so, what is the best way to do this?
My previous answer showed a different approach for the problem without using too many workarounds. This answer will try to give exactly what has been asked.
First thing to understand is that you can't have the values for two different companies if you're filtering to show only one company. That means you'll need to circumvent this by filtering directly on the field.
Step 1: Create the new parameters that will be used as filters.
You want to create two parameters called "Company 1" and "Company 2" that will be used in each view to filter the company on the graphic.
Step 2: Create the new measures with the filter directly in the field.
Now you should create two new measures from your main measure, each one filtering one of the companies accordingly to the parameter, e.g. Sales Company 1 and Sales Company 2.
Step 3: Create a field with the variation and add it at the tooltip mark.
Simply enough, you want a calculated field with the difference between them:
SUM([Sales C1]) - SUM([Sales C2])
Step 4: Update the views and dashboard
Change the measure in each of the views for their following specific measure field, and remove the Company filter. And in the dashboard, substitute your usual filters to the parameter (which will be used to filter both views).
By assuming you have a dashboard with two views, you'll be filtering the [Company] in both of these views, making the value of another company not available to be shown at the tooltip.
If you're not using it yet, you could try a new approach and see the variance between companies by using the Color mark. By adding the [Company] as color, you could turn the Stack Marks off and add the second company in the filter to be able to visualize the difference.

Form Validation on Group of items

Here is the page: http://hawaiianoptics.com/visa
Customer can only select on product and then needs to select color of that product. Can only select one product and one color. What's the easiest way to do this?
Use a radio on all of the products then do separate validation on the dropdowns?
Thanks!

Descrese quantity when order is placed

I want to decrement quantity 10 of particular product each time place an order by customer in magento. its don't matter what quantity added in product detail page by customer.
Please help
Maybe using observer like sales_quote_add_item, will allow you to set custom quantity once the product is added to the cart.

Set two prices per product for one store

I want to set different prices for two customers.
If customer is commercial, than price should be $10.00.
If customer is government, than price should be $5.00.
How can I set this ?
Create two groups, put the customers there in and define group prices for both groups.
But be careful, it only works if the standard price is higher than $10
Which Magento version are you running ? With the latest versions you can simple create a customer group (customer tab in backend) and than assign a group price in the product > price tab for each group.