Shopify Tutorial - Cart Transform Shopify Function

Поделиться
HTML-код
  • Опубликовано: 6 окт 2024

Комментарии • 56

  • @NikitaShevchenko-rc5th
    @NikitaShevchenko-rc5th 6 месяцев назад +9

    100% more understandable than Shopify docs, thank you!

  • @gustavoadolforamirezapache2053
    @gustavoadolforamirezapache2053 8 месяцев назад

    Man, thank you so much! You've been really helpful, and your channel is excellent. The promo code video helped me a lot. I wanted to ask you one last thing: I haven't been able to find any hook or something to access the theme settings. Previously, we had certain options in the theme to set certain parameters. It turns out that I need to access those options in my app extension, but I haven't been able to figure out how. It seems like you're really knowledgeable about this topic, so maybe you could help me clear up this doubt. Thank you very much, and seriously, yours is the best channel I've found this year.

    • @stackingcontext
      @stackingcontext  7 месяцев назад +1

      As far as I know there's currently no way to access theme settings from an app extension but you could try setting those options in a shop metaobject, which you can then access from both your theme and your extension.

  • @TravisRayLive
    @TravisRayLive 4 месяца назад

    Really wish the text was bigger. 14" laptop and the text is so incredibly small and hard to read, but a great tutorial none-the-less.

  • @DavidMiller-co5ok
    @DavidMiller-co5ok 5 месяцев назад

    Very useful for the app we are building at Spresso. Thank you so much!

  • @natanic2746
    @natanic2746 4 месяца назад

    Thank you for the video. It would be nice to see more on dynamic data like metafields like time 39:34

  • @Demigod177712
    @Demigod177712 5 месяцев назад

    Very useful video. Just what I looked for. Thank you so much!

  • @vanhanguyen5658
    @vanhanguyen5658 9 дней назад

    Thank you very much, this tutorial has helped me a lot, but I have a problem related to bundle product, how can I hide it outside the store and not let customers see it?

    • @stackingcontext
      @stackingcontext  9 дней назад

      Use the seo hidden metafield community.shopify.com/c/shopify-discussions/hide-a-product-from-seo-and-from-the-shopify-frontend-search/m-p/1898122
      You can also add a redirect from that specific product page so customers can't land there.

  • @bunnyhilloverkill-rockcove8813
    @bunnyhilloverkill-rockcove8813 3 месяца назад

    Hello and thank you very much. I was able to implement this successfully. Can you perhaps explain to me why the changed title and the changed image are only visible on the checkout page! I would like to see it already on the cart page.

  • @DanielDuenas-ie4rw
    @DanielDuenas-ie4rw 2 месяца назад

    This is very helpful! Thanks a lot.
    But, is there any way to get discount information in cart transform API?

  • @MirunaAndriesei
    @MirunaAndriesei 7 месяцев назад +1

    This video is amazing, thank you so much

  • @AlessioDePadova
    @AlessioDePadova 3 месяца назад

    Thank you for this video.
    It is really helpful.

  • @Juceisv
    @Juceisv 6 месяцев назад +1

    Thanks for the video, it's great, I have a question: Is it possible to use Cart Transform Shopify Function to hide block sections at checkout? i mean, being able to hide an entire block of shipping addresses to upload your own?

    • @stackingcontext
      @stackingcontext  6 месяцев назад +2

      Try seeing if what you're trying to do can be accomplished with the Delivery Customization function shopify.dev/docs/api/functions/reference/delivery-customization, beyond that I'm not aware of another method to hide Shipping Options right now.

  • @tomaszposiadaa5174
    @tomaszposiadaa5174 7 месяцев назад

    Thank you! great video as always :) Do you happen to know how in case of cart expand/merge operation would it show in Shopify analytics/reporting? Would it be possible to get information on how many times the items were purchased as a bundle?

    • @stackingcontext
      @stackingcontext  7 месяцев назад

      Thanks! Unfortunately I'm not very familiar with Shopity Analytics, so I can't give you a definitive answer here, but if it's possible to create reports based on whether a product had a property present in the cart at the time of purchase then you should be able to get the number of times certain products were bought as part of a bundle.

  • @МаксимДраганов-е8м
    @МаксимДраганов-е8м 8 месяцев назад

    Exactly what I need. Thanks.

  • @rotshi6684
    @rotshi6684 8 месяцев назад +1

    Keep doing Shopify please.

  • @panzerdp
    @panzerdp Месяц назад

    A BIG thank you!

  • @salug1987
    @salug1987 6 месяцев назад

    Thank you for the tutorial! It is really helpful. Just one question.. Do you know a way to disable discounts on already discounted bundles? Maybe even the other way around to not add a discount with the Cart Transform function but add a discount based on the title of the bundle or something. unfortunately there is no way to discount a product based on a custom property of a line item..

    • @stackingcontext
      @stackingcontext  6 месяцев назад

      I think that by creating a Product Discount function you might be able to only apply the discount to the products containing certain properties.

  • @NielKennethSantos
    @NielKennethSantos 8 месяцев назад +1

    Keep it going man! I Just subscribe to your channel

  • @whoami7208
    @whoami7208 Месяц назад

    The parent variant quantity always remains at 1, but the bundle items quantity are adjusted incorrectly. On the cart page, when increase the quantity, the bundle items double with each click: first to 2, then 4, 8, 16, 32, 64....., resulting in a 2x increase each time.

    • @stackingcontext
      @stackingcontext  Месяц назад

      When you increase the quantity of a bundled line item Shopify will increase the quantity of each of its components by one so that is why you are seeing that behavior. You could add logic to your Cart Transform function to detect when this happens and put the items into separate bundles accordingly.

  • @santiagorossi2877
    @santiagorossi2877 4 месяца назад

    Amazing my friend. Have you found a way to show how much discount you have in the bundle at Checkout? I managed to put it in the title, but i would prefer to have the full price slashed or something more visible with the prices, do you think that's possible?
    saludos desde argentina

    • @stackingcontext
      @stackingcontext  4 месяца назад

      I don't know of a way to slash the prices in bundles currently but something else you could do is add a cart like property with the discounted value, which should carry out into the Checkout flow too.

  • @sudharsanamtk
    @sudharsanamtk 3 месяца назад

    Thank you for the video! Its really very informative. Is there a way to show a custom image on Cart page also? My usecase is user can change color/shape of the product and can add to the cart. I have to show that custom colour along with the shape on checkout and also cart page. After going through your video for next requirement is a way to upload the customized product image to shopify cdn somehow, not sure how to do it also.

    • @stackingcontext
      @stackingcontext  3 месяца назад +1

      The Cart page is controlled from your theme, so you should be able to edit that template and add your image there.
      As for uploading an image to Shopify CDN, if you need to do it from Checkout then that's not possible at the moment as there is no File Input component for Checkout UI Extensions yet.

  • @ericmainhard2325
    @ericmainhard2325 7 месяцев назад

    This is so amazing gooood thank you!!!
    I'm trying to assign to the decreasePercentage in the merge operation, the value from a metafield in the bundle product. But as this product is not in the cart, and not comming from the RunInput, can I create a query request inside the run.js file?

    • @stackingcontext
      @stackingcontext  7 месяцев назад

      Unfortunately asynchronous code isn't available in Shopify Functions at the moment shopify.dev/docs/apps/functions/language-support/javascript#available-javascript-apis
      If you need that value to be dynamic your best option might be an app metafield of type json where you match parentVariantIds with their decrease percentage, but you will have to build a UI for that to make it editable by the merchant.

    • @ericmainhard2325
      @ericmainhard2325 7 месяцев назад +1

      @@stackingcontext ouu that sucks, and how would you do to give the client the possibility to assign the percentage discount manually instead of fixed?

  • @marinasouzalucas7363
    @marinasouzalucas7363 3 месяца назад

    Thank you so much!

  • @TechTrends_10
    @TechTrends_10 6 месяцев назад

    It is a really used video for the Cart Transform Function, Could you please provide the source code of this video.

  • @FixEcomm
    @FixEcomm 8 месяцев назад

    you're amazing man ..

  • @MichaelRoberts-n2s
    @MichaelRoberts-n2s 4 месяца назад

    Thanks - this is great!
    But holy guacamole, I'm looking to try and do what seems like a pretty simple thing - display the Compare at Price if one exists for the item. Does anyone know how to do this with a Shopify Function Extension?

    • @stackingcontext
      @stackingcontext  4 месяца назад

      You might have an easier time doing that with a Checkout UI Extension that targets purchase.checkout.cart-line-item.render-after

    • @MichaelRoberts-n2s
      @MichaelRoberts-n2s 4 месяца назад

      @@stackingcontext I'll check that out - thank you!

  • @dio56301
    @dio56301 2 месяца назад

    Have you seen any way to get the customer tax_exempt value in the cart transform function? It doesn't look like this is available and this prevents me from adapting the fixedpriceadjustments according to tax. So then we have to start looking at hooks to update this setting to a customer metafield or cart attribute as those are available... just sending it along with the cart isnt an option as it might get set in the checkout. I think this is an oversight from shopify.

    • @stackingcontext
      @stackingcontext  2 месяца назад

      That property doesn't look to be available in the input query for cart transform functions but an option could be to query the value in a Checkout UI Extension and set it as a cart attribute during checkout.

    • @dio56301
      @dio56301 2 месяца назад

      @@stackingcontext yes lol that is exactly what I did

  • @AadarshKumarSingh-s1j
    @AadarshKumarSingh-s1j Месяц назад

    if i want to remove any product which is mistakenly added into bundle then what's the procedure for that?
    Please tell me.

    • @stackingcontext
      @stackingcontext  Месяц назад

      Currently Shopify Functions can't remove products from the cart

  • @CS-oh7zu
    @CS-oh7zu 5 месяцев назад

    Awesome Thanks

  • @AadarshKumarSingh-s1j
    @AadarshKumarSingh-s1j 2 месяца назад

    If i want to fixed the price of bundle as 99 then can we use merge and update for the bundle or how can i do so

    • @stackingcontext
      @stackingcontext  2 месяца назад

      You can sum the price of all products in the bundle and compute the percentage by which you will need to discount it to get to a fixed price of 99.

  • @MikeDavis-u7i
    @MikeDavis-u7i 6 месяцев назад

    How would you go about adding a dynamic variant? I have a page where a customer selects an add-on product (bound to a metaobject) to add to the main product sold. The id of this metaobject is added as a property to the cart. I want to use an expandCartItems operation to achieve this. However, how can I use the id of the metaobject to pull out the correct data I need. This metaobject will have a price and a product object.

    • @stackingcontext
      @stackingcontext  6 месяцев назад

      You can try passing the variant id, price and any other information you need as a cart line property to the function.

    • @MikeDavis-u7i
      @MikeDavis-u7i 6 месяцев назад

      @@stackingcontext I did pass the variant id, but I don't think it makes sense to pass the price. Why can't I look up the product and get the info? Is this even the correct way to do it? Should I add all of these as separate items in the cart and then bundle them?

  • @FixEcomm
    @FixEcomm 7 месяцев назад

    is there anyone else having an issue with checkout session,it keeps remembering the first selected bundle even after I cleared the cart. I 've turned off the 'Development store preview' but still when i add new bundle then checkout ,it always shows the first bundle unless I use incognito .!!

    • @FixEcomm
      @FixEcomm 7 месяцев назад +1

      issue seems to be fixed after removing item with key '__ui' from local storage when cart is empty

  • @ProgramatoryPl
    @ProgramatoryPl 6 месяцев назад

    Regarding expand operation if add 2 then i will have 4 - any way to limit ?

    • @ivanyu8880
      @ivanyu8880 2 месяца назад

      I'm having the same issue, were you able to find a solution?

  • @MichaelRoberts-n2s
    @MichaelRoberts-n2s 4 месяца назад

    Hm, my comments with a link keep disappearing, so I'll try without it. When I make a Checkout UI extension (which doesn't have graphql), and then try the code from Shopify's docs (replacing the Banner code the extensions comes with) for "purchase.checkout.cart-line-item.render-after" the {target} object is undefined. On that page, I also don't see any access to Compare at Price. I've asked Shopify's AI bot, and it said "You can access the Compare At Price through the cartLineItem.variant.compareAtPrice property in the purchase.checkout.cart-line-item.render-after target." But I don't see any of that in the docs :-/

    • @stackingcontext
      @stackingcontext  3 месяца назад

      Checkout UI Extensions have Graphql Access. The useApi hook returns a query function which you can then use to interact with the Graphql API and request the compare at price.
      I query the graphql API from a Checkout UI Extension in this video ruclips.net/video/L-Kyx-pRoYI/видео.html