Skip to content

Add "Cart URL" API #1853

@JustinSainton

Description

@JustinSainton

wpsc_get_add_to_cart_url should create a custom URL that will redirect a user to a cart, filled with items passed to the URL.

Now, originally, I was thinking about just a query string of the cart items, passed to the add_to_cart handler. But this can be problematic on some nginx configurations, and many Apache configurations if the query string is greater than 4,000 characters.

What might make sense is that the it generates a a hash that corresponds to a saved array that is then posted as a cart, and the user is then redirected to the checkout page.

Need to do some more thinking on this, but I like the thought generally. And even without the API - as of 4a5c55b, this can be done via GET string.

Cart URLs like this can be used for Buy Now buttons, Buy Now buttons for packages of products, links to include in email campaigns - lots of great use cases.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions