Sort shopping cart by collection in Shopfiy - sorting

Sorry in advance for the Shopify question:
I am trying to finish a store for my friend and he needs the shopping cart to sort the items by what Collection they are in. This is a menu for fresh food delivered daily and each collection is a day, so I am trying to display the cart by Monday, Tuesday, etc. I think I have an idea of how to do this in liquid, but am new to Shopify and liquid, so please forgive me.
I think the two routes could be by using product.collections (which returns a list of all collections that an item is part of), or by using tags on each item and using product.tags to return that tag.
Then by using these I can display them appropriately on the page.
UPDATE:
I have most of the logic there, I just can't seem to put the labels in correctly now.
{% for item in cart.items %}
{%if item.product.tags contains 'Monday' %}
This displays what I need as far as the items in the right order, my problem now is getting only 1 title or h4 to appear for each category.
Any help would be greatly appreciated.

Nevermind, all I had to do was add a table head with the tag name above each of:
{% for item in cart.items %}
{%if item.product.tags contains 'Monday' %}
Everything came out wonderfully!

Related

Using Timber and Shopify, how can I add meta fields on the ajax mini cart of timber?

I’m using Timber in a Shopify theme.
I would look to add meta fields of the product on the cart.
Cart screenshot here
The metafields are showing on product i would like to show that on Ajax mini cart too. product page screenshot
js code here
Let me know if its possible.
Here are a few examples on how you may access a product's metafields.
In the cart page though, because you don't have a direct access to the product object, you should first get access to the product object via the [line_item][2] object to be able to access the metafields, example:
{% for item in cart.items %}
{{ item.product.metafields.key }}
{% endfor %}
And that should do the trick!

Mailchimp cart content block

I am creating a website with mailchimp integration using their API. I am using their drag and drop cart block content feature, it seems that the price that is reflected in that block is not the price of the cart but the price of the product.
My first solution is to get the price using a cart merge tag, I have been searching for merge tags but cant find any website that provides me this merge tags.
I would like to use the cart price instead, does anyone knows how can I put the cart price? I've been looking for solution for this problem all day. I hope one of you can help me.
Thank you.
Check this video as well
https://www.youtube.com/watch?v=nTi4nU8ZOj0
You can use the merge tag ABANDONED_CART to create custom html for abandoned cart emails.
Example:
<table>
*|ABANDONED_CART:[$total=3]|*
<tr>
<td><img src="*|PRODUCT:IMAGE_URL|*"/></td>
<td>*|PRODUCT:TITLE|*</td>
<td>*|PRODUCT:PRICE|*</td>
</tr>
*|END:ABANDONED_CART|*
</table>
Go to Cart
The $total=3 in the ABANDONED_CART tag changes the number of products that will be shown.
*|CART:URL|* - Generates the url for your cart.
This doesn't seem possible. Here's a very recent list of available tags from mailchimp . There's no CART block or CART_PRICE tag.
I contacted mailchimp support with a similar query.
ME:
I'd like to customize the contents of the cart
block. The test emails/ abandoned carts I have created use the
checkout_url as the product image link within the template. Is it
possible to have the cart block product image link url set to that of
the product or the product link variant?
If that is not possible is there an equivalent PRODUCT_CART tag to
PRODUCT_RECOMMENDATIONS as documented here
http://kb.mailchimp.com/merge-tags/all-the-merge-tags-cheat-sheet#Merge-Tags-for-Product-Recommendations
that I could use to construct my own abandoned cart email, not using the
predefined cart block drag and drop content block.
In summary:
1) Within the cart block is it possible to have the product images link
to the products and not the checkout_url?
2) Is there a tag not listed in
http://kb.mailchimp.com/merge-tags/all-the-merge-tags-cheat-sheet to
iterate over cart products?
SUPPORT:
There is not a way to change the URL linked to the product image. Additionally, those products must be pulled in using the abandoned cart content blocks, and cannot be populated using a merge tag.
That being said, I do agree these would be great options to have, and I would be happy to pass that feedback along for you. Our developers monitor these suggestions and often use that feedback for future versions of the application. So thank you for giving us your idea, as it may be very useful for a lot of our users in the future.
Let us know if you have any other questions on this, and have a great rest of your day.

Filter by tags in all collections in Shopify

I've scoured the web and still have not found an answer to this question.
Shopify has the ability to use product tags as a filter, but it only works after a collection has been selected. I would like to program it so that the customer can filter all products by tag before a collection has been chosen.
The only "answer" I've found is this article, which again, only explains how to have a dropdown after a collection has been selected.
Please help!
You could create a collection containing all products, and then filter by tags on that collection.
See this article in the Shopify docs for how to create a collection containing all products:
Add a collection with title 'All' and which you set to Automatically select products based on conditions.
Set the product condition 'Product price is greater than 0'. Then click save.
Then you can go ahead and filter the collection using tags.

Sort topmenu in Magento?

This is really driving me crazy. I have been trying for hours to get it right, but no luck!
All i want is to be able to sort the parent & subcategories in the topmenu of Magento. I tried a lot of custom coding, but all what Ive found seems to be out of date. Then i also tried to just move the categories order in the admin panel of Magento. This seems to work, but only for parent categories. It won't sort the subcategories. In addition, for some strange reason it will put the old order back again. So for instance, when i sorted the parent categories, it seems to work but when i refresh the admin page the old sorted categories are back and when i refresh the frontpage i see (indeed) the old (wrong) sorted categories back. Might have something to do with the cache ? It should be so simple (i hope:)). Is there anyone who can tell me how i can sort the categories and subcategories (custom, or by id, or anything else...)?
Thanks.
I feel these urls will help you in this case
http://www.magentocommerce.com/wiki/4_-_themes_and_template_customization/catalog/getting_and_using_categories_and_subcategories
How to sort a category list array alphabetically in Magento

To have site.pages or site.projects of template data in octopress?

In official jekyll doc: Template Data, we have site.posts for a reverse chronological list of all Posts. Can we have site.pages for a list of all Pages? Or, if we create some customized layout, like project, how to have site.projects for all Projects?

Resources