-- HikaShop version -- : 2.6.4
On this forums i found the Hide Addresses plugin.
It works great, but i would like to hide all addresses except the default address.
So would it be possible to add something like "if address_default != 1 " in this code?
<?php
class plgHikashopAddress extends JPlugin
{
function __construct(&$subject, $config) {
parent::__construct($subject, $config);
}
function onAfterOrderCreate(&$order,&$send_email) {
if(empty($order->order_shipping_address_id) && empty($order->order_billing_address_id))
return true;
$address = hikashop_get('class.address');
if(!empty($order->order_shipping_address_id) && $order->order_shipping_address_id != $order->order_billing_address_id) {
$obj = new stdClass();
$obj->address_id = $order->order_shipping_address_id;
$obj->address_published = 0;
$address->save($obj);
}
if(!empty($order->order_billing_address_id)) {
$obj = new stdClass();
$obj->address_id = $order->order_billing_address_id;
$obj->address_published = 0;
$address->save($obj);
}
return true;
}
}