Hi All
I'm looking to make more than just the "reciever" and "email" fields required at the checkout area of miniShop2 v2.1.3-pl2. I tried the easy route of just adding the class "required" to the same container as ".input-parent", but this is stripped automatically upon page load.
I've found lines 135 + 136 of the [[!msOrder]] snippet:
$response = $miniShop2->order->getDeliveryRequiresFields();
$requires = $response['data']['requires'];
Git shows the function getDeliveryRequiresFields() is in the file "core/components/minishop2/model/minishop2/msorderhandler.class.php" lines 275-292:
/**
* Returns required fields for delivery
*
* @param $id
*
* @return array|string
*/
public function getDeliveryRequiresFields($id = 0) {
if (empty($id)) {$id = $this->order['delivery'];}
/* @var msDelivery $delivery */
if (!$delivery = $this->modx->getObject('msDelivery', array('id' => $id, 'active' => 1))) {
return $this->error('ms2_order_err_delivery', array('delivery'));
}
$requires = $delivery->get('requires');
$requires = empty($requires) ? array() : array_map('trim', explode(',', $requires));
if (!in_array('email', $requires)) {$requires[] = 'email';}
return $this->success('', array('requires' => $requires));
}
so I tried adjusting my snippet call to:
[[!msOrder? &requires=`email,receiver,phone,comment,street,city,region,index`]]
but to no avail, also tried "&delivery=" and "&deliveries="
Does anyone have any ideas? I'm sure I could hack the core and add my own list into the handler - but that's ugly and no future-proof...
Thanks in advance
Kyle
[ed. note: kctechsoln last edited this post 10 years, 4 months ago.]