Jump to content

edit all in one shipping output


tploumis

Recommended Posts

Hi, i would like to ask where exactly i can edit the output of the All In one Shipping module, what i want to do, is NOT show the price next to the available shipping methods names ( it comes as (price)(method name), i want only the name of each shipping method to be shown in my cart )

 

Thank you in advance

Link to comment
Share on other sites

Depending on your version of CC5, look in the file /classes/cubecart.class.php, near line 1436:

 $GLOBALS['tax']->exchangeRate($data['value'], (!empty($data['currency'])) ? $data['currency'] : $GLOBALS['config']->get('config', 'default_currency'));
$value    = array(
    'offset'    => $offset,
    'name'        => $data['name'],
    'value'        => $data['value'],
    'tax_id'    => $data['tax_id'],
);
$shipping_values[] = $value;
$data['name'] = empty($data['name']) ? '' : ' ('.$data['name'].')';
$data['desc'] = empty($data['desc']) ? '' : ' ('.$data['desc'].')';
$option    = array(
    'value'        => base64url_encode(json_encode($value)),
    'display'    => (isset($data['name'])) ? $GLOBALS['tax']->priceFormat($data['value'], true).$data['name'] : $data['desc']
);

Looking at the 'display' line, if this shipping option has a name, then show the price followed by the prepared name. If not, then show the prepared description.

 

N.B. This code is weird. Four lines up, $data['name'] gets set to either a zero-length-string, or the name in parentheses. The point is that it does get set no matter what. Then, in the 'display' line, the test is for being set, which it will always be.

 

Anyway, if you are familiar with PHP, you should be able to figure out what you need to do. If you need instruction, let us know.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...