Shopify / mobile-buy-sdk-android

Shopify’s Mobile Buy SDK makes it simple to sell physical products inside your mobile app. With a few lines of code, you can connect your app with the Shopify platform and let your users buy your products using their credit card.
MIT License
216 stars 136 forks source link

How to Add custom attributes to the products while checkout #621

Open Bhargavasrinivas opened 4 years ago

Bhargavasrinivas commented 4 years ago

Hi I need to add some custom attributes to Products while checkout , here i need to pass Gift Wrap option as a Custom attribute , Below is my code snippate

private List attributvalue = new ArrayList<>(); attributvalue.add(new Storefront.AttributeInput("Gift Wrap", "Yes") );

input = new Storefront.CheckoutCreateInput() .setLineItemsInput(Input.value(datalist) ).setCustomAttributesInput(Input.value(attributvalue));

    Storefront.MutationQuery query = Storefront.mutation(mutationQuery -> mutationQuery
            .checkoutCreate(input, createPayloadQuery -> createPayloadQuery
                    .checkout(checkoutQuery -> checkoutQuery
                            .webUrl()
                            .totalPrice()
                            .subtotalPrice()

                    )
                    .userErrors(userErrorQuery -> userErrorQuery
                            .field()
                            .message()
                    )
            )
    );

but still no luck for me its not adding any Custom attributes to checkout . Any help is appreciated.

ranamrameez commented 4 years ago

if you are processing checkout through StoreFrontApi, can you please share your code with me? I am getting an error on Polling for shipping rates gives error "Failed to reschedule GraphQL query execution". And I havn't found a correct solution.