Ordering products by product type in Shopify - shopify

I've been asked by a client is it possible for them to be able to manually order product(Types) on the front-end instead of using the default A-Z option.
For example:
Customer visits product listing page
Selects product type from the filterable options E.G "t-shirts"
Products show based on that query but are organised how they have defined possibly in the backend somewhere, or as a Shopify setting that I setup.
I can't seem to find anything from digging around on the internet and I can't think how I'd do this on my own but wondered if anyone else ha had experience or ideas for how this could be achieved.

You could define a collection with the condition "Product type is equal to your_type". Then after you save the collection you can choose to order the products manually (the default is alphabetically).

Related

Shopify changing product price for variation by app

I am a shopify partner, I am trying to get around the the variant limits of shopify by coding an app and also because my client has a complicated formula for calculating the price. I don't have a problem with the part that adds the information for my variants to the order, however when I want to modify the price based on the user selection, it doesn't seem an easy task to do.
I came across couple of apps which does the same thing by adding a new product or variation which is not optimal for my use case, is there any app that does the job without adding extra information to the database, if so, how?
Qualified Yes
Unfortunately, Shopify doesn't give us a lot of options to edit prices of items dynamically. Here are the two options that I know of that will allow you to adjust the price of a product directly - however, both have limitations.
Using Shopify Script Editor
If you're working with a Shopify Plus merchant, you can use the Shopify Script Editor to dynamically adjust the prices of products, provided that the direction you adjust is down. You cannot increase the price of a product using the script editor - so for your use case, the list price would have to be the most expensive possible price that the item sells for, which you would then discount appropriately using the app.
Using draft orders
Using an app, you can use Shopify's Draft Order API to create an order with custom discounts and/or create completely custom items that are independent of the products set up in the product database.
The basic flow for this is that when the customer clicks 'checkout' you halt the normal navigation, send the cart contents to your app, create a draft order with the appropriate pricing, then supply the front-end code with the draft-order checkout/invoice URL so that you can send the customer there instead of the normal checkout. This has several limitations, however, including that prices of existing products can only be discounted, not increased, and the fact that Shopify will not allow a customer to use discount codes on a draft order invoice - once an order is set up this way, Shopify's assumption is that all prices are final.
Disclaimer: Sorry if someone sensible doesn't like a response with a link :) I'm not related to this app I'm just a user.
On a project with complex pricing, we use the app Wholesale Pricing Discount by Wholesale Helper we liked because is easy to import multiple pricing by-product and relate it by customer.
this app does not multiply the products, they use customer tags. maybe that can give you some guidance.
An important rule on Shopify is you can't increase the price by API on an order, you can just reduce i

Displaying First Collection That Was Assigned to Product

I'm trying to change my product breadcrumb to display the first collection of a product (rather than showing the path the user took to reach the product).
I'm using the code product.collections[0] to show the first collection... but this displays the collections in A-Z order rather than the first collection that was added to the product.
Is there a way to call the first collection that was added to the product rather than ordering it A-Z?
Conceptually there is nothing in Shopify to support your cause. If you have a product you can get the list of collections it belongs to, but there is no support for a hierarchy or temporal access time. If you need to keep track of which collections a customer hits per product, you will need to do that yourself, manually, with JS.
Ever since day 0 of Shopify, I am sure there has been a wish for Shopify to somehow keep track of the collection that was selected when a customer selected a product, but to date, even that is not supported at all.

Shopify variable price for a single product

I am about to display a rack builder in my shopify.
The users can set various customization like the number of rows and columns and the size of each cell and its door option for each cell.
The problem is that I would like to know how to enable variable price for that product. I think I cant use variant product as it will be limited in number.
This will require quite a lot of customisation.
First you will need to split your rack elements into separate products:
doors
rows
columns
sizes
You will need to enter variants for each of the different elements.
Once you are done with that you will need to create a page that allows you to customise the product showing the options from the product elements you created above.
You will need to collect the product customisation with JS and add the appropriate amount of each element to the cart.
In case the customer have the option of manual input and the price is changed based on that ( for example the size of the wood ) then the functionality will become even more complex.
Long story short it will be hard to code, the administration will be complex and the user experience won't be nice.
Another way will be to look into some APP that can help you with this, but I'm not sure if there is one that has this kind of functionality.

VirtoCommerce API getting item prices

I am using VirtoCommerce 2.9 and have some questions regarding the API and what would be the best way to get all the information I need, while keeping the number of API requests down.
Right now I am using the endpoint /api/catalog/search to find items that matches a number of attributes. But the response does not include prices and product texts. Both I would like to present to the end user. What would be the correct or best way to retrieve this information?
Thanks!
Cheers!
Currently search service does not return the description and price for the products.
To get this details you need to use separate queries
api/catalog/product/ids?respGroup='ItemSmall'
to get product detail with description and
api/pricing/evaluate
to retrieve actual products prices. You can call them in parallel for better performance.
Be aware to use WithProperties response group because it may cause
perfomance problem. Anyway product returned with all properties values
and this 'response group' is only responsible for retrieving properties meta-information
(as possible dictionary values, multilingual, required or optional flag etc) this information often used in admin area and in storefront almost not used.
Indexed search module will be serious changed in future versions, and you will be able to have more control over the product details in the search index.

Setting carrier per product

I'm working on a store that has two types of products: perishable food and general merchandise. The food must always be shipped overnight via FedEx, and the other merchandise must always be shipped via USPS. If somebody orders products from both categories, they must be shipped separately.
Do you know of an existing module or configuration settings that would allow for this?
If not, it sounds like a custom module would be the other solution. In this case, what is the best approach? I'm thinking it would be splitting the order into a multi-address shipment, using the same address for both but with different shipping methods. Unfortunately I'm not sure how to do this programatically, so any tutorials/samples/resources would be greatly appreciated.
Probably the sanest way to handle this would be to create two orders per product type, each shipping with a different carrier to the same address. This also IMO makes more sense from a stores tracking perspective as you can handle each independently from each other.
To get you on the right track(since Magento is especially cryptic in this part of itself) you should read the Inchoo programmatically create order in Magento post and by the same author Programatically create customer and order in Magento with full blown one page checkout.
Basically as I see this going is:
Get the customer order
Itinerate through each product inside the order and split it up in two arrays for each product type
Create a separate order for each product type and use the different shipping methods for each.
You will probably have to extend a some controllers OR do it the non-standard way and use helper functions for this, the hard parts will be integrating the payment/shipping modules inside your order process. Going this way will have you creating the full checkout process as the one page checkout Magento provides won't really work and is too much pain to get to work because of the way it uses AJAX.
Also another alternative is to hook in to Magento's pre-create order events and create the orders there using already defined order data split it up in two orders, but this is something I never heard or saw implemented at the moment so you'd have to do it "blindfolded" so to speak.
An easier approach would be to use a custom field that defines your product's shipping method, this way you just add that and don't care about custom orders. You just react with that, however tracking will become mostly impossible IMO.
Over-ride the Free Shipping module.
You can setup a sales rule that applies to certain products and makes them 'Free Shipping', leaving the other products to your chosen main shipment provider.
You will need to see how this works, however, the point is that Magento does have something built in to split an order into two shipping categories, albeit only a sales rule on free shipping. But you have source code...