X3 Cart Plugin [under construction] 🚧
Posted: 01 May 2022, 09:28
Cart demo can be found here:
cart.photo.gallery
Dear folks, I'm in the middle of creating a new X3 "cart" plugin, as requested and as promised [1, 2, 3]. I am making this post while creating the plugin, because I am looking for feedback. Basically, the cart plugin allows website visitors to check/add images to cart, and then the cart offers two distinct features (you can enable one, or both):
Cart Download
This option basically allows the visitor to download all selected items as a zip file. It wasn't initially the plan to include this feature, but it goes nicely alongside the cart plugin. It can of course be enabled or disabled, regardless of the "order" option, which is the main concept of the cart plugin. The download feature is pretty straight-forward, and I do not require any feedback.
Cart Send Order
This option allows visitors to "send order" for selected cart items, in which case the website owner (you) will receive an email with a list of images selected by user. This feature is generic/multi-purpose, and allows the website owner (you) to serve a response, for example print, serve originals or retouch photos (etc). The cart can be enabled/disabled on a per-page basis. As I started the development, several questions arose, and I would appreciate any feedback:
Cart details and display order
As in the screenshot above, the cart items will generally include a preview image, file name and path. I can't think of any other details. The cart may of course include items from multiple galleries. When user adds a new item to cart, it will get added to TOP of the cart, as that is most intuitive and easy to track ... This means that the display order in the cart will NOT match the order of images in the gallery of course. * If cart items get added into the middle of the cart to match gallery order, it would be impossible for the user to track new items they add.
User submission identification?
How do you intend to identify the user that has submitted the order? In some cases, it may be a "protected" gallery, or you may be in direct contact with a user who is about to submit an order, in which case identification is easy. However, how to identify unknown requests? As far as I can think, we will need name, email and perhaps even message input fields that must be populated by the user when submitting the order. I don't see any other way to identify the user that makes the order.
Dummy orders
Unless you enable the cart only for protected galleries, you may get "dummy" orders from unknown users. This could be random visitors, fake emails (users testing functionality), or even known users that send multiple orders (maybe their first order was wrong). There is no logical way for X3 to solve this. When you get an email order, you will either ignore it or reply by using your own logic.
Global cart or per-page cart?
The cart will be "global" by default, meaning the visitor can add cart items from multiple galleries before submitting the order. I am hoping there is no need for isolated per-page carts, as that would be very complicated to implement. In such case, when navigating between pages, the cart would have to empty and update itself to show only selected items from current gallery. Seems confusing for the visitor also.
Orders storage JSON
For convenience, I have already implemented a method to store all orders in JSON format /config/cart/order.{DATE}.json. This is mainly backup, as it allows you to lookup orders without using email. It would be possible to build an interface for this from the panel, although that would be a lot of work :tired_face:
Changed file names and deleted files
There is no way for X3 to track changes to file paths that may affect existing cart orders. For example, if you delete, move or rename images, you may be breaking links in existing cart order emails (and stored JSON files). In most cases, you will deal with orders as soon as they are received, so it won't be a problem.
Email template
When an order is submitted, X3 will send an email to website owner (you) with a clickable list of all images. I can't see what else we can add to the email template to make it more useful. Basically, it would look something like this:Do we need custom template option?
This cart feature is not without logical challenges. Is there anything else required? Any useful feedback appreciated!
cart.photo.gallery
Dear folks, I'm in the middle of creating a new X3 "cart" plugin, as requested and as promised [1, 2, 3]. I am making this post while creating the plugin, because I am looking for feedback. Basically, the cart plugin allows website visitors to check/add images to cart, and then the cart offers two distinct features (you can enable one, or both):
- "Send order" for selected cart items. Email gets sent to website owner.
- Download selected cart items.
Cart Download
This option basically allows the visitor to download all selected items as a zip file. It wasn't initially the plan to include this feature, but it goes nicely alongside the cart plugin. It can of course be enabled or disabled, regardless of the "order" option, which is the main concept of the cart plugin. The download feature is pretty straight-forward, and I do not require any feedback.
Cart Send Order
This option allows visitors to "send order" for selected cart items, in which case the website owner (you) will receive an email with a list of images selected by user. This feature is generic/multi-purpose, and allows the website owner (you) to serve a response, for example print, serve originals or retouch photos (etc). The cart can be enabled/disabled on a per-page basis. As I started the development, several questions arose, and I would appreciate any feedback:
Cart details and display order
As in the screenshot above, the cart items will generally include a preview image, file name and path. I can't think of any other details. The cart may of course include items from multiple galleries. When user adds a new item to cart, it will get added to TOP of the cart, as that is most intuitive and easy to track ... This means that the display order in the cart will NOT match the order of images in the gallery of course. * If cart items get added into the middle of the cart to match gallery order, it would be impossible for the user to track new items they add.
User submission identification?
How do you intend to identify the user that has submitted the order? In some cases, it may be a "protected" gallery, or you may be in direct contact with a user who is about to submit an order, in which case identification is easy. However, how to identify unknown requests? As far as I can think, we will need name, email and perhaps even message input fields that must be populated by the user when submitting the order. I don't see any other way to identify the user that makes the order.
Dummy orders
Unless you enable the cart only for protected galleries, you may get "dummy" orders from unknown users. This could be random visitors, fake emails (users testing functionality), or even known users that send multiple orders (maybe their first order was wrong). There is no logical way for X3 to solve this. When you get an email order, you will either ignore it or reply by using your own logic.
Global cart or per-page cart?
The cart will be "global" by default, meaning the visitor can add cart items from multiple galleries before submitting the order. I am hoping there is no need for isolated per-page carts, as that would be very complicated to implement. In such case, when navigating between pages, the cart would have to empty and update itself to show only selected items from current gallery. Seems confusing for the visitor also.
Orders storage JSON
For convenience, I have already implemented a method to store all orders in JSON format /config/cart/order.{DATE}.json. This is mainly backup, as it allows you to lookup orders without using email. It would be possible to build an interface for this from the panel, although that would be a lot of work :tired_face:
Changed file names and deleted files
There is no way for X3 to track changes to file paths that may affect existing cart orders. For example, if you delete, move or rename images, you may be breaking links in existing cart order emails (and stored JSON files). In most cases, you will deal with orders as soon as they are received, so it won't be a problem.
Email template
When an order is submitted, X3 will send an email to website owner (you) with a clickable list of all images. I can't see what else we can add to the email template to make it more useful. Basically, it would look something like this:
Code
{name}
{email}
{page} (because it might be useful, even if images are added from multiple galleries)
{message} (because you might need special instructions from the client)
[b]Cart[/b]
link/to/image1.jpg
link/to/image2.jpg
link/to/image3.jpg
This cart feature is not without logical challenges. Is there anything else required? Any useful feedback appreciated!