Can I change price with checkout create/update

SylarRuby
Shopify Partner
21 0 2

Possible? You can on the carts page but what about on the checkout page?

ShopifyAPI::LineItem.new({

  # I see no line items id?

}).save

How to change price? Must be able to on checkout page. Cart has no customer info so not useful. Im using Ruby on Rails.

Replies 7 (7)

PageSpeedGuru
Shopify Partner
47 0 7

Hi again,

Why would you want to? Isn't the right method actally to change the price on the product, have multiple product prices or operate with some form of rebate on the product itself.

 

Best regards

Tonny

Shopify PageSpeed Expert | Speed up your Shop and Earn 45% more, Get 31% more Traffic and Boost Conversion Rates by 20%

SylarRuby
Shopify Partner
21 0 2

Life would have been great to know which customer is logged in. I must have the customer info. If I have that...the gates of heaven opens.

PageSpeedGuru
Shopify Partner
47 0 7

Use this 🙂

https://help.shopify.com/api/reference/customer

Shopify PageSpeed Expert | Speed up your Shop and Earn 45% more, Get 31% more Traffic and Boost Conversion Rates by 20%

SylarRuby
Shopify Partner
21 0 2

I dont think that's useful. This gives me the current shop details

ShopifyAPI::Shop.current

I'm looking for something like

ShopifyAPI::Customer.current

 

PageSpeedGuru
Shopify Partner
47 0 7

I see the issue. What you want is probably not accessible. I approached shopify about this last year, they control the "session" and you have no access. But it looks like you can maybe make a hack as the user object seem to be exposed in Liquid. Just use a Jquery Ajax or som other javascript to send the "info" to your Ruby code and take it from there.

Best

Tonny

Shopify PageSpeed Expert | Speed up your Shop and Earn 45% more, Get 31% more Traffic and Boost Conversion Rates by 20%

PageSpeedGuru
Shopify Partner
47 0 7

Forgot the link:

https://ecommerce.shopify.com/c/shopify-apis-and-technology/t/anyway-i-can-find-out-customer-id-of-l...

Shopify PageSpeed Expert | Speed up your Shop and Earn 45% more, Get 31% more Traffic and Boost Conversion Rates by 20%

SylarRuby
Shopify Partner
21 0 2

Thanks, Tip. I'll see what I can come up with.