Delivery Details in Cart

76 views
Skip to first unread message

Rianna Stephens

unread,
Oct 30, 2019, 6:56:03 AM10/30/19
to XMPie Interest Group
Hello

I need to have a date field in the cart so that my customer can add in the delivery date required, they need this as a mandatory feature but obviously do not want to add this to every single product they add to the cart, does anyone know of a work around for this?

Or is there a way to make a product mandatory so i can have all the questions needed just on 1 product instead of all of them?

Rianna

Wayne

unread,
Oct 30, 2019, 5:55:12 PM10/30/19
to XMPie Interest Group
Hi Rianna,
The only way to Add an Order Property as such is via a Clearing Method such as CostCentre Clearing.
You can use JavaScript to add a date picker.
Of course if you are already using a clearing method such as PayPal then Product Properties is your only option.
There is no out of the box method to make a Product Mandatory however you could achieve this with JavaScript code also.

Regards,
Wayne

Rianna Stephens

unread,
Oct 31, 2019, 6:27:16 AM10/31/19
to XMPie Interest Group
HI Wayne

Thansk for your reply, if i can get the product to be mandatory then i can put all the questions needed as a product property on one product. The problem is we dont really know where to start with making it mandatory using Javascript, could you point us in the right direction to help us get started on this?

Kind regards
Rianna

Wayne

unread,
Oct 31, 2019, 8:52:58 AM10/31/19
to XMPie Interest Group
Hi Rianna
You didn't mention what uStore Version or Skin you are using. This script is tested in uStore 11.1 
Many ways to do make a Product Mandatory using JavaScript.
This script should get you started add this script to the Store Front Javascript.
Please note comments to update product name and url

<script>
$( document ).ready(function() {
if(window.location.pathname.indexOf('/ustore/Cart') > -1){
var mandatoryProduct = 'MyMandatoryProduct';//Product Name
if ($('.productName').find('label:contains('+mandatoryProduct+')').parent().parent().parent().find('input[type=checkbox]:checked').length ==1 && $('.productName').find('label:contains('+mandatoryProduct+')').length== 1){
console.log('Product ' +mandatoryProduct+' in Cart')
//$('#ctl00_cphMainContent_BtnSubmit').attr("disabled", "disabled").css("pointer-events","none");
} else{
$('#ctl00_cphMainContent_BtnSubmit').attr("disabled", "disabled").css("pointer-events","none");
$('#trTop').after('<a href="/ustore/#storeid#/Category/#categoryid#/Product/#productid#/">Click here to add Mandatory Product</a>');//update url to your #storeid# #categoryid# #productid#
}
}
});
</script>

Regards,
Wayne

Rianna Stephens

unread,
Oct 31, 2019, 10:38:22 AM10/31/19
to XMPie Interest Group
Thanks Wayne

We are using version 9.4, can this be modified for our version?

Kind regards

Wayne

unread,
Oct 31, 2019, 3:52:34 PM10/31/19
to XMPie Interest Group
Yes this script should still work

Rianna Stephens

unread,
Nov 1, 2019, 4:59:11 PM11/1/19
to XMPie Interest Group
Hi Wayne

We got this working! Thanks for your help!

Rianna

Wayne

unread,
Nov 1, 2019, 11:17:44 PM11/1/19
to XMPie Interest Group
Your welcome, glad you got it working.

Regards,
Wayne
Reply all
Reply to author
Forward
0 new messages