I just seem to be stuck with the IF’s and Importhtml/Xms etc.
My goal: I want a spreadsheet, where I put info like, EAN (GTIN-13), ASIN (Amazon Unique Article code). Now I want sheets to go to ebay.de & Amazon.de, take the price cheapest price from both sides - decides which price is cheaper. And subtracts 5% - this than is my finals price.
When the Article is neu or new others (Neu, Neu: Sonstige (siehe Artikelbeschreibung))
Eg. Cheapest prices: eBay 40€ - Amazon 39€ // 39€<40€= 39€-5% = 37,05€ -> if the Article does not exist on one or the other, than it will only take the number, from the existing one -5%
The system however preferably, also should see, if shipping is included and add it to the price.
Eg. Cheapest prices: eBay 40€ +5€ shipping = 45€ - Amazon 50€ // 45€<50€= 45€-5% = 42,75€
Price level:
0-100€ = -5% ///
100-1000€ = -10% ////
1000€ and more -15€
When the article is used, broken etc. (Gebraucht, Als Ersatzteil / defekt, Vom Verkäufer generalüberholt)
It only takes from ebay with the Used URL + Filter.
URLS:
eBay new: (this URL is with filter activation, for cheapest price wit shipping - Buy Now, EU Sellers, Accepting Returns & neu All these attributes are reflected in the URL.
https://www.ebay.de/sch/i.html?_from=R40&_nkw=4548736101548&LH_PrefLoc=3&LH_BIN=1&LH_RPA=1&LH_ItemCondition=3&_sop=15
eBay Used
https://www.ebay.de/sch/i.html?_from=R40&_nkw=4548736101548&LH_PrefLoc=3&LH_BIN=1&LH_RPA=1&_sop=15&rt=nc&LH_ItemCondition=4
EAN can be automatically added from list:
New:
="https://www.ebay.de/sch/i.html?_from=R40&_nkw="&""&C2&""&"&LH_PrefLoc=3&LH_BIN=1&LH_RPA=1&LH_ItemCondition=3&_sop=15"
Used:
="https://www.ebay.de/sch/i.html?_from=R40&_nkw="&""&C2&""&"&LH_PrefLoc=3&LH_BIN=1&LH_RPA=1&_sop=15&rt=nc&LH_ItemCondition=4"
Amazon
https://www.amazon.de/s?k=B07WD5978Q
="https://www.amazon.de/s?k="&""&B2
With
=IMPORTXML(I2;"//*[#id='search']/div[1]/div[1]/div/span[3]/div[2]/div[2]/div/span/div/div/div[2]/div[3]/div/a/span[1]/span[2]/span[1]")
I have tried to get the price from Amazon, but it doesn’t work.
From ebay I can get the price with:
=IMPORTXML(G2;"//*[#id='srp-river-results']/ul/li[1]/div/div[2]/div[3]/div[1]/span")
But not including the shipping cost in this example. Also I don't want the EUR to show but only plane number.
All other steps I need, like IF’s - Conditions (Used & New) etc. I have tried multiply option but completely failed.
You can find here an example spreadsheet I prepared but I just can't get further than this
https://docs.google.com/spreadsheets/d/1DqnW4G_FQlnc8vVbz_q2wPako0VuExGcDkWCSACxXEk/edit#gid=705413209
I don't know if what I want is impossible to achieve. Maybe there is also another way than from what I was thinking.
About any directions hints I would be glad since I only have a little more than basic knowledge.
Thank you
Lisa
for amazon, you will need to use API: https://aws.amazon.com/api-gateway/
after that your formula will be:
=IF(REGEXEXTRACT(IMPORTXML(G2; "//*[#id='srp-river-results']/ul/li[1]/div/div[2]/div[3]/div[1]/span"); "\d+(?:.\d+)?")+
IFERROR(REGEXEXTRACT(INDEX(IMPORTXML(G2; "//span[#class='s-item__shipping s-item__logisticsCost']"); 1); "\d+(?:.\d+)?"); 0)>
formula(from_amazon)+formula(for_shipping_from_amazon);
(formula(from_amazon)+formula(for_shipping_from_amazon))-(formula(from_amazon)+formula(for_shipping_from_amazon))*5%;
(REGEXEXTRACT(IMPORTXML(G2; "//*[#id='srp-river-results']/ul/li[1]/div/div[2]/div[3]/div[1]/span"); "\d+(?:.\d+)?")+
IFERROR(REGEXEXTRACT(INDEX(IMPORTXML(G2; "//span[#class='s-item__shipping s-item__logisticsCost']"); 1); "\d+(?:.\d+)?"); 0))-(
IMPORTXML(G2; "//*[#id='srp-river-results']/ul/li[1]/div/div[2]/div[3]/div[1]/span")+
IFERROR(REGEXEXTRACT(INDEX(IMPORTXML(G2; "//span[#class='s-item__shipping s-item__logisticsCost']"); 1); "\d+(?:.\d+)?"); 0))*5%)
Related
I am setting up a site (WP) which will essentially sell one type of product and integrating a mobile app (ionic).
Multiple vendors can sell (WC Vendors) the variable product on the site at different quantities (100 litres, 200 litres etc).
I need to be able to make a GET request to return each vendors variable product for that quantity.
e.g. Customer selects they want 300 litres in the mobile app, I then use the API to return all variable products for that quantity (300 litres). So in the end, I have a response which will contain something like below;
Vendor: Vendor 1, Product: Product Name, Quantity: 300 litres, Price: £200
Is this possible as the WC API stands now?
For anyone else struggling on this, I finally got it to work by using the tags as suggested above and to query by tags using this;
https://example.com/wp-json/wc/v3/products?tag=20?consumer_key=ck_xxxxxxxxxxxxxxxxx&consumer_secret=cs_2xxxxxxxxxxxxx
I think you need to rephrase this a little bit, But From what I can get. You have a Vendor and a Product that has a Quantity of 300 L which in the first place I'd recommend you Should avoid, Rather just use Liter , Now what I'd Recommend is Tag's.
You'd have your Vendors and products under Categories.
And you can Set Tags on Products that you'd like to have what you require.
Then When someone Selects 300L , 200L It will pull every Product with the Tag 200L And you'll be able to display them.
Official Document
/wp-json/wc/v3/products/tags/<id>
They have:
id integer Unique identifier for the resource. name string Tag name.
slug string An alphanumeric identifier for the resource unique to its type.
description string HTML description of the resource.
count integer Number of published products for the resource.
The problem
We have created a customer segment and linked both a customer and a price list to this customer segment. The linked price list defines a special price of $5 for one of the products. This product has a 'default' price of $10.
When I login to the storefront with a user that belongs to customer segment, I see the correct price of $5 on the PDP. However once this product is added to the basket, it shows the 'default' product price of $10 in the minicart and on the cart page. I would expect to see $5 there as well.
Technical information
The (correct) price on the PDP is retrieved directly from the ProductBO by using the default ISProductPrice module which links to the default ProductPrice.isml.
<ISProductPrice
ProductBO="#ProductBO#"
Currency="#CurrentRequest:Currency#"
ShowInformationalPrice="true"
RichSnippetsEnabled="#RichSnippetsEnabled#"
>
The (wrong) price on the cart page is retrieved from the BasketComputedProductLineItemBO with the following (default ISH) code
<isif condition="#PriceDisplayType EQ 'net'#">
<isprint value="#PLI:SingleBasePriceNet#">
<iselse/>
<isprint value="#PLI:SingleBasePriceGross#">
</isif>
What I've tried so far
Clear cookies/cache to make sure we have a completely new basket
Made sure the Customer Segmentation Service is enabled (default ISH service).
Tried all the different methods to fetch a price from the BasketComputedProductLineItemBO
Added a couple of different products to the price list
Added a couple of different customers to the customer segment
Ran a search index
Tried to reproduce the issue on the ISH demo server
Checked the documentation on customer segmentation from the ISH support page
Tried to add a customer to the price list directly instead of a customer segment. When doing it this way, everything seems to work as expected.
At this point I'm completely stuck. Any help on how to go from here would be greatly appreciated.
Check this
https://support.intershop.com/kb/index.php/Display/IS-22923
If you search on segment on the support for version 7.9 then you get few bugs. Disable the dynamic segment service because it is buggy. See if that work or else i think you really do have a platform bug here.
Also a good idea to upgrade to the lastest minor version.
I've implemented a filter as per this WooCommerce article on taxes:
add_filter('woocommerce_adjust_non_base_location_prices', '__return_false');
This effectively 'ignores' tax rates on checkout: an €8,99 product (where prices are added inclusive of tax) being sold from a UK store will cost €8,99 to a German customer, a French customer or an ROI customer. This all works fine on the front end.
However, I just created an order in the backend for a German customer, and that €8,99 product is being added to the order at €7,49 with no tax. I understand from a tax perspective why this is happening (a UK store selling in Germany shouldn't apply tax, so 8.99 - 20% UK VAT = 7.49), however this seems to be ignoring my woocommerce_adjust_non_base_location_prices filter.
At the moment my filter call is just a single line in a custom plugin, so being implemented at plugins_loaded, I guess. There's no condition for it (e.g. if (!is_admin()) {}), so I'm wondering if I need some other kind of condition to ensure it is applied to admin orders, or if I'm looking at a bug?
I am looking for a way to allow two products to share the same stock/inventory. Everything I have come across suggests using variations but this doesn't work in my case.
This is my current situation. I am selling a unisex t-shirt but would like it to show up in both the mens section and womens section on my store. The tees already have variations in that they are being sold in sizes XS-XL. Ideally, in the mens section the product image would be of a male model wearing the tee and in the womens section the product image would be of a female model wearing the tee. So they're technically two different products but at the end of the day it's all coming from one stock, so I need these two products to share their inventory.
Any help would be much appreciated! Thanks in advance :)
You could technically achieve this by using SQL code and events.
ie,
Create two products that are to share the same stock
Create SQL script that updates the stock level of both products to the lowest amount where there is a mismatch
Create SQL event in database that activates this basic script every 15 minutes.
It's not perfect, and it probably won't work on a shared server (rarely do you have event access on shared services), but it works in theory. You could also do this via cron/php script, but I'm not great at php so, meh.
Here's a similar thing I did for cost of goods sold in my database:
UPDATE wpi1_postmeta as pm
INNER JOIN wpi1_atum_product_data as atum
ON atum.product_id = pm.post_id
SET pm.meta_value = atum.purchase_price
WHERE atum.purchase_price is not NULL
AND atum.purchase_price <> pm.meta_value
AND pm.meta_key = '_woosea_cost_of_good_sold';
I am developing an e-commerce site for use in the UK, and have been required to let the user buy products either with or without tax included.
I have slightly modified the AAC module to show prices either including or excluding VAT depending on a cookie which is set via a "view prices including/excluding" link, but of course whenever a product is added to cart, the price is that from the database - i.e. including VAT.
Does anyone know of any neat tricks or modules that would let me do this?
We've decided to go for just viewing prices excluding the vat, and not being able to buy them at the excluding vat price.
In case anyone needs it, here is the code/formula used to get the full price and work out the lower vat-free price:
(line 217-222 of uc_aac.module in my version - and you will need a div with the class "excluding_VAT").
//Get the updated price, minus VAT
new_val = parseFloat(updated_price.substr(1));
new_val = (100/115) * new_val;
new_val = Math.round(new_val*Math.pow(10,2))/Math.pow(10,2);
$(".excluding_VAT").html("£"+new_val+" exc VAT");