Set product to never get out of stock in WooCommerce - php

I have a WooCommerce store and there are basically 2 categories. 1. Diamonds and 2. Engagement Rings
The category Engagement Rings have only 5 products which are Variable Products
I am importing Diamond Category Products from API and they are simple products. There is no any issue in this process. But it has a feature that sets all other products out of stock which are not in that API response.
I want to set something like Category Engagement Ring product should never get Out of Stock.
Is there any possibility I can achieve that?
I know this question can get downvotes as it is not logical enough. But to save time I want to implement this as a temporary fix. and then I am going to make the procedure fully responsible for this kind of stuff.

Related

Ecommerce database design, save product information without affecting historical data

What would be the best, if not, the practical way to design an e-commerce database wherein the product information of the product purchased by a customer should not update when the product information was updated?
To give a better understanding, here's a scenario:
Merchant created "Product A" where it is priced at $50.
Customer saw Product A and purchased it.
Customer visited the transaction history and viewed his recent purchase: Product A priced at $50
Month's after, Merchant updated the price of Product A to $80.
Customer viewed again his transaction history. His transaction with Product A should retain at $50 and not the updated price of $80 because it was the price he paid that time.
One solution I am looking into is to save the whole product information in a table as a PHP serialized data in "purchases.product_information".
Is it even a good idea to store PHP serialized data in a column? How's performance if a user wanted to search for a text in the product information like price, item name, etc.?
Any other workaround for this?
Thank you
It is a case of slowly changing dimensions (https://en.wikipedia.org/wiki/Slowly_changing_dimension)
A simple solution will be to have a separate table purchase_items and have all the columns that may change over time against each item (Example:price, discount etc) and purchase and purchase_items table will have one_to_many relationship
Although, there are more complex situations where the price of the product changes on the fly based on the time at which an order is made in a day etc. In these cases, the price may not be stored against the product itself
This answer is addresses exactly the issue and you might find this helpful
https://dba.stackexchange.com/questions/57992/ecommerce-orders-table-save-prices-or-use-an-audit-history-table

Prestashop: Variable price based on product processing

I have one more complex questions, so I will split it. Since it is basically one topic I don't wanna to split it into two separate threads. I would be grateful either for any information about an existing module, or any idea how to do this by yourself.
Question #1
If I understand the product price calculation process in Prestashop I basically have two options:
Price defined on a product
Price defined on a product combination
What I need, though, is to provide customer with more advanced calculation. Let's say products can be assembled and equipped with multiple different tags. Therefore, I can't use product_attribute (Combination) as no matter if I assemble the product or not, it is always the same product with only one physical amount of products on stock. As if it was a Combination, and customer order the product assembled, the stock would only be decreased on for this Combination, but not for the other Combinations. Hope that makes sense.
Example:
Painting #348 + frame + additional service = $500
Painting #348 + frame = $375
Painting #348 = $345
It is even more complicated as these sort of "additional services" are only available to relevant products. Another products may offer customers different "additional services".
Question #2
For scenarios from Question #1, I need also to differentiate the price. So if a customer wants to buy 300 pieces of a painting with frame it is $10 cheaper per product. If the amount is over 500, it's $25 cheaper etc. I know I can do this for a regular product or a combination, but how would you do it if the price would be custom just like in Question #1.
Thanks a lot for any help!
I am not sure if i have understood your question completely or not but, as far as i understood here is your solution:
You may have a product:
XYZ Pizza
(with different toppings like chicken, red meat)
(also have sizes Small, Medium and Large)
Off course you will have different prices for different combination.
So what you can do is:
Create a product XYZ Pizza with price zero and quantity zero.
Add combinations to the product, so you just need to add actual price of that
combinations, no headache of increase decrease calculations for price.
It is super easy if you are using csv import.
And don't worry as long as you have a single combination with some price for that product the zero prices won't be shown on your website.
Hope it helps.

Magento - How to create 1 Product that will essentially link to 2 others?

My questions is basically I have 2 products that can be sold separately and together.
What I want to do is take these 2 individual items, create a new product in Magento for it with a new image that will show both of them together for a combined price. When this particular item is sold then it will reduce the qty from each of the individual sku's that were created. Is this possible?
As an example,
SKU 1 - Wii Remote - $30
SKU 2 - Wii Nunchuk - $15
SKU 3 - Wii Remote + Nunhcuk - $45
So when sku 3 is sold it will reduce the qty of sku 1 and 2.
Thank you
Maybe a "bundle" could help you?
http://www.magentocommerce.com/knowledge-base/entry/creating-a-bundled-product
I don't know for sure, because I have never used Magento. I just Googled your problem.
A bundle product will do if your rules are within these:
Points to Remember
A Bundle is a “build your own” product type
Bundle Items can be Simple or Virtual products, but without Custom Variants and Options
The Price View of a Bundle can be set to display a price range or “As Low as”
The SKU and Weight of a Bundle product can be set to either “Fixed” or “Dynamic”
Items can have either a preset or user-defined quantity
Items can be shipped together or separately
Bundle product data cannot be imported into your catalog.
Means : bundle product cannot have a configurable product within.
so if your SKU1 and SKU2 are not configurable or rather just simple or virtual then you can create a bundle product and sell the way you have stated.
I don't necessarily agree with the way magento wants us to sell our "Bundles"
It lets users decide which products they want to combine, it's really similar to a "Grouped product".
To me a bundle is predetermined by the store owner, If A is Bought together with B & C, then the customer saves X amount of money... It's not up to the customer to decide what's part of the bundle.
SO I ended up creating the Bundle, adding all the products I want in the bundle as a "Multiple Select", ticked them all as "Default",
and I'm hiding the options with CSS, only showing the price and the add to cart button (Every product has it's own class in ): body.product-name #product-options-wrapper { display: none }
So of course if you have thousands of bundles then this won't work for you.
I'm really happy with this solution because 1. It updates the inventory & 2. All of the SKUs are displayed on the invoice! (For me they are also lot numbers)

Inventory with multi - unit support feature

I have been developing an Inventory system (PHP Codeigniter & MySQL), I have setup almost everything except one feature which one of my clients wants to implement to the system - A multi - unit support feature for the system.
Currently my system only supports single unit per item per transaction:
item_desc: Item1
default_unit: pc
reorder: 1
in_stock: 25
remain: 25
In multi - unit feature, this would become:
item_desc: Item1
default_unit: pc
big_unit: pack
pack_size: 50
reorder: 1
in_stock: 25 pack
remain: 24 pack 5 pc
Can someone give me hint on probably the easy way to implement this? I just want to know where to start on this thing. I would appreciate much if someone could share an idea regarding on this one :)
We just launched v2 of our website and I've gone through 8 months of all kinds of questions like this myself. The best way to do it is to separate your tables into products, inventory and listings.
Products holds product specific information only, things that will never change.
Inventory holds information about current inventory only, ie quantity on hand, backorder, location in warehouse etc.
Listings are how you handle the multi item support. This table would hold listing information and draw from the other two tables for the product and quantity data. So you'd have a basic table structure something like this
Products
productId
productName
productModel
productDescription
Inventory
inventoryId
productId
quantityOnHand
location
Listings
listingId
inventoryId
quantityInListing
numberOfListings
price
Our company sells a lot of preowned things so the listings change regularly, but you could always set the listings up to auto-populate based on inventory if you're selling new things that you just restock. Doing it this way means you don't end up with a ton of data duplication as you would if you just created products for the multiples. It also allows you to sell any item in any quantity and set prices for those quantities manually.

Camouflage product id's on website

I'm currently building a retail e-shop for a jewellery manufacturer which also sells wholesale to other shops and I'm looking for an efficient way to "hide"/"camouflage" the product id's for all products so that other competitors wont be able to see the product's barcodes and find out that the manufacturer is doing direct sales at lower prices.
All products on the website have a 4-5 digit id which is also the name of the products' images, ie for Product #1234 image filename is 1234.jpg
One thought was to add a 3-digit random int before and after the product ID that would make it quite hard for someone to figure out the product id. Another thought would be to reverse the id's or perform some sort of scrambling. This would work fine for all the links within the site and all i'd have to do would be to strip off the first and last 3 digits off the product id's or de-scramble before using in the queries but what can I do when it comes to displaying product images? I don't want visitors to be able to see the filenames, that would completely blow the cover for a ll product id's.
Suggestions and ideas are very welcome.
You shouldn't allow direct access to your images like that. Instead, use a php wrapper which translates your fake product id to the actual image file and return that.
Ie http://.../getimage.php?fakeid=1337 which translates that into the actual product id 123 and then readfile("/path/to/123.png");
The products don't need to be identified by barcode - you could use a meaningless identifier for the products, and only look up the barcode when you actually need it. Example:
product_barcode | product_identifier
7310791268002 | deadbeef01234cafe
Then, you'd use deadbeef01234cafe both for identifying the product in the store, and for the image name.

Categories