Page 1 of 1

Element Cart Modification

PostPosted: Tue May 17, 2022 4:19 pm
by tmlogo
I have tweaked the Element Cart template, but still would like to add a price per product as we deal with quantity purchases. I see that it uses [-- SC_CART_V2 --] which does not allow for the item price just the final total. I like the layout better than [-- SC_CART --] Is there a workaround for this as I like the rest of the layout.

Thanks in advance.

Re: Element Cart Modification

PostPosted: Thu May 19, 2022 7:11 am
by ShopSite Lauren
You could add the following javascript on your shopping cart page either in the template or in the "text at the bottom of the shopping cart screen" field found under Commerce > Order System > Shopping Cart.

Code: Select all
<script type="text/javascript">
for (i = 0; i < number_products; i++) {
 document.getElementsByClassName("cart-product-quantity")[i].innerHTML = "Each - $" + ss_price[i] + "<br>" + document.getElementsByClassName("cart-product-quantity")[i].innerHTML;
}
</script>

Re: Element Cart Modification

PostPosted: Thu May 19, 2022 2:29 pm
by tmlogo
Thank you so much! That's just what I needed.

I do have one more question, is there anyway possible for people to upload a file (logo) as an option in their shopping cart and have it associated with their order?

Re: Element Cart Modification

PostPosted: Wed May 25, 2022 2:34 pm
by ShopSite Lauren
No, that isn't a feature in ShopSite. You could add some javascript on the thank you screen to detect products that need a logo, then display a link to another page where you have an upload feature outside of ShopSite (ask your hosting provider if this is something they could set up on your domain...some hosts don't allow 'just anyone' to upload for security reasons). Depending on how your external upload feature works, you may be able to name the upload with the customer's order number or something like that (order number could be passed pretty easily to the upload page, if the upload page would have anywhere to put that information).

That probably all sounds like a lot. First I would suggest contacting your hosting provider and see if there is a way they could set up an upload page on your domain where visitors could upload files. Then if you DM me, I can help you from there.

Re: Element Cart Modification

PostPosted: Fri Jun 10, 2022 12:55 pm
by tmlogo
Thank you Lauren. It appears that the upload won't be possible with our host.

I did have one more template question. The pages automatically generate "Page:" even if the number of products for that page fills only one page. Is there a way to let the template know not to put "Page:" unless there are enough products for multiple pages?

Re: Element Cart Modification

PostPosted: Tue Jun 14, 2022 3:44 pm
by ShopSite Lauren
You could add an IF statement around the previous/next links... so this...

[-- IF PAGE.ProductsPerPage NE 0 --]<div id="top-pagination" class="pagination d-flex flex-wrap justify-content-center align-items-center mb-4"><span class="pr-2 font-weight-bold">[-- STORE.454 --]</span> [-- PrevNext NoCenter --]</div>[-- END_IF --]

would become this...

[-- IF PAGE.ProductsPerPage NE 0 --][-- IF PAGE.ProductsPerPage LT PAGE.NumProducts --]<div id="top-pagination" class="pagination d-flex flex-wrap justify-content-center align-items-center mb-4"><span class="pr-2 font-weight-bold">[-- STORE.454 --]</span> [-- PrevNext NoCenter --]</div>[-- END_IF --][-- END_IF --]


I added the [-- IF PAGE.ProductsPerPage LT PAGE.NumProducts --][-- END_IF --] statement. This says IF the number of products per page is Less Than (LT) the number of products that are assigned to the page, then proceed with the code for the pagination.