Shopware : How to set a free gift to customer based on number of orders? - plugins

I want to implement new functionality for customers to give label and a free gift on number of orders.
See below.
Order No Label Gift
Order #1 – “Magnet” - Spoon
Order #2 – “Löffel” - Woods Table
Order #3 – “Extra Glas” - Chair
Order #4 – “Korbmarke” - Table
Order #5 – “Schneidebrett” - Xyz
Order #10 – “Beutel” - ABC
I have already purchased one plugin but it will provide functionality to add a free gift to customer if order amount is Greater Or Less then X amount then you will get a free gift.
https://store.shopware.com/en/dvsn891149791221/automatically-add-premium-items/gifts-to-shopping-cart.html
Can anyone help me how can I setup free gift on number of orders rather than price?
Is there any ready made plugin available for this functionality?
Any help would be appreciated...!
Thanks in advance..!

Related

I need help in data sanitization problem in tableau

I trying doing the manual sanitization, however I am getting a type mismatch error in performing the calculations.
I also need help in sanitizing the data and getting the insight as per the below instructions:
The column sellerproductcount gives you the count of products in the
form '1-16 of over 100,000 results' , and you can parse out the product count 100,000.
sellerratings - this columns gives you the % and count of positive ratings (e.g. 88% positive
in the last 12 months (118 ratings) ) if parsed correctly
sellerdetails - you can use this text to parse out phone numbers, and email IDs of
merchants, where available, so our team can reach out to them.
businessaddress - this will give you the business locations of the sellers. You can parse them
to identify if a seller is registered in the US , Germany (DE), or China (CN).
Hero Product 1 #ratings and Hero Product 2 #ratings - these 2 columns give you the number of
ratings of the 2 'hero products' or bestselling products of this seller.
I have attached the dataset for the same.
https://docs.google.com/spreadsheets/d/1PSqRCnmFgq7v7RzZaCXXoV0Edp_vM7QO/edit?usp=sharing&ouid=115547990006782902200&rtpof=true&sd=true
Most of this type of data prep can be done with string & RegEx functions like REGEX_MATCH(). Here are a few examples based on the data you shared:
Seller Product Count
INT(REGEXP_EXTRACT([Sellerproductcount], '(\d*,?\d*) results'))
1-16 of over 6,000 results >> 6000
Seller Rating (Percentage)
INT(REGEXP_EXTRACT([Sellerratings], '(\d*)% positive'))
92% positive in the last 12 months (181 ratings) >> 92
Seller Rating (Count)
INT(REGEXP_EXTRACT([Sellerratings], '(\d*) (?:total )?ratings'))
92% positive in the last 12 months (181 ratings) >> 181
Business Country Code
RIGHT([Businessaddress],2)
AM Treptower Park28-30Berlin12435DE >> DE
These examples all have very straightforward patterns that are present in all rows so they can be done pretty easily with one simple calculation. However, something like sellerdetails which is unstructured, inconsistent, and sometimes incomplete will be a bit more of a challenge. You will need to use a couple of different calculations and techniques combined together to find what you are looking for, as well as some manual data prep. Here's an example of how you can pull out email but it won't work for everything:
Email
REGEXP_EXTRACT([Sellerdetails], '([a-zA-Z0-9.!#$%&’*+/=?^_`{|}~-]+#[a-zA-Z0-9-]+(?:\.[a-zA-Z0-9-]+)*)')
Good luck with your data cleaning, I suggest using sites like https://regex101.com/ and https://regexr.com/ to learn more about and help test regular expressions.

Magento - keep product stock quantity at 0 when reached but still allow backorders

We have a Magento multi-store installation. We would like to prevent product stock levels from going below "0" when 0 quantity is reached but still allow those products to be purchased. When a product is sold out, we simply drop-ship it from another company. The main goal is to not have negative counts in the inventory. Currently, when a product is dropped shipped because we're out of stock, we have to manually change the stock quantity back to "0" from "-1" in the product's inventory field. Any suggestions would be greatly appreciated on how to make this happen.
Thank you,
Jim

ATG - Can an Order Level Discount be applied to Items?

Consider I have two items in my cart 50 USD each , I also have a coupon '20 USD off 100'. when I apply this my cart will look like below (for simplicity and focus I am eliminating tax and shipping)
Item 1 50 X1 = 50
Item 2 50 X1 = 50
subtotal =100
discount (-)20
**Total 80
now I have multiple cases where I have to split this 20 USD to items so that returns at third party are easy , also in situations where the two items will be fulfilled by two independent vendors.
I understand that ATG's ReturnManager class provide wealth of methods to calculate returns and does consider all item shipping order discounts and taxes.
but is there a way I can split the order discount to items Out of the Box based on weighted average algorithm.
Thanks
The simplest way to do this would be, to do the splitting algorithm in a Order Pipeline Processor (custom processor) store the split Item Level Discount Shares in a ApportionmentInfo repository item. Whenever, a return occurs you need to access this repository item through the order and display it to the user.
Regards,
Gaurav E
You Can't
Basically OrderPricingEngine will set adjusment against OrderPriceInfo. you cant do apportionment that to item level because the trigger is on order.
Best practice is expose a reprice Order as service to thirdparty. Re run the calculation
and identify the return value. If you customize per promotion level it will open up pandora box of reprice order issue.

Display all orders in which a certain product was purchased - Crystal Reports

I've searched all over many sites today and I am unable to find an answer to this. I am trying to display all orders in which a certain product (scarf) was purchased. For Example:
Order #1
Hat $3.00
Scarf $5.00
Order #2
Puzzel $2.00
Order #3
Scarf $5.00
With this example, I'd like to display records #1 and #3, in which a scarf was purchased, but also include "Hat" that was purchased along with the scarf in Order #1...(while excluding Order #2)
Output should be:
Order #1
Hat $3.00
Scarf $5.00
Order #3
Scarf $5.00
I've tried using instr functions to filter this information out, as well as looks for various formulas, but I cannot seem to figure this out. I appreciate everyone's time!
John
Create a SOL-expression field:
// {%order_has_scarf}
// assumes table in main report is `orders`
(
SELECT count(1) total
FROM orders o
WHERE o.order_id = orders.order_id
)
Alter record-selection formula:
AND {%order_has_scarf} > 0
Create a group of orders first then place the fields in detail (Hat..etc) and write a supress condition for detail and group like:
if Order="PUZZEL"
then true
else false
with this condition if puzzel is encountered then both detail and group are supressed.
Thanks everyone, i actaully figured out how to do this. I added another instance of the Order Details table to my crystal report, then I filtered that table by the Item ID related to the scarf, then linked that to the original order table...that way, only orders containing this particular Item ID would be passed to the original table.
Hope this makes sense!

crystal reports total of values field

I'm using Crystal Reports 10 right now and I have my report almost finished. I have a group of customers and for each customer, I have multiple lines of customer information. The one thing I'm still trying to figure out though is how can I get a running total of one column's distinct values.
So, for example I have a customer Bob who has 6 different items. For each item, there is a manufacturer. It might be the same for all 6 items, it might be one for 3 of them and another for the other 3, or they might all be different. What I want is to have a field at the bottom of the group for Bob that would say:
Man1 - 3
Man2 - 1
Man3 - 2
with the manufacturer being on the left side and the number of items they make for that customer on the right side.
Is there anything in Crystal Reports that can do this right now? Or can someone give me some advice on where I would get started on a formula to do this? Thanks for any help you guys can give.
Need more information:
What kind of data structure are we talking about? How are the manufacturer and item data found? How are these related to the customer? How many manufacturers/items are typically found per customer?
If the manufacturer and items are two different fields, that might be simple (cross tab in customer group). If they are free form, that might be a problem. If there are separate fields for every manufacturer (I've see it happen), then that might be a problem.
Best scenario:
One field for manufacturer, one field for item, distinct relation to customer.
Possible solution:
Group by customer, sub-group by manufacturer, count of items.
Not best scenario:
Table for customer, separate table for each manufacturer.
Possible solution:
Main report, group by customer. Linked subreport on Manufacturer/items.
Worst scenario:
Free-text entry of manufacturer and items in a memo field.
Possible solution:
Redesign your database (grin).
If you have to, you can do this using logic tests through formulas, but if you have many manufacturers/items, it would get exhaustive.
Best answer: More information.