Jump to content

All in One Shipping Module Gets a Custom Name


bsmither

Recommended Posts

CubeCart added the ability to have a shipping module acquire a user-supplied "group name". This group name appears in the shipping selector for the group of related shipping products. The group name is also databased as the 'ship_method'. This has been the shipping module's folder name, but now can be overridden. See this issue in the Github.

It seems this group name is also used extensively throughout CubeCart -- emails, order summary, print invoice, etc.

These are the edits needed to have the All in One Shipping module (indeed, any shipping module) stop showing the folder name and instead show a user-supplied name.

This is the test that decides to use
the specified name, if it exists. If
not, use the default name.
++++++++
In the file shipping.class.php, near line 293, find:

public function calculate() {

Add BEFORE that, the following:

public function groupName() {

    return (isset($this->_settings['group_name']) && !empty($this->_settings['group_name'])) ? $this->_settings['group_name'] : $this->_group_name;
}

 

This the default name the module will
use if there isn't one specified in
the module's settings panel.
++++++++
In the file, shipping.class.php, near line 28, find:

private $_debug_lines;

Add AFTER:

private $_group_name = "All In One Shipping";
This adds the text entry field where
you may specify the name to show for
using this module - the "ship_method'.
++++++++
In the file skin/admin/index.tpl, near line 15, find:

<div><label for="status">{$LANG.common.status}</label><span><input type="hidden" name="module[status]" id="status" class="toggle" value="{$MODULE.status}" /></span></div>

Add AFTER:

<div><label for="group_name">{$LANG.all_in_one_shipping.ship_method_name}</label><span><input type="text" name="module[group_name]" id="group_name" class="textbox" value="{$MODULE.group_name}" /></span></div>
This adds the needed language phrase
for the module's settings panel.
++++++++
In the file language/module.definitions.xml, near line 3, find:

<group name="all_in_one_shipping">

Add AFTER:

<string name="ship_method_name"><![CDATA[Name to show as shipping method]]></string>

For example, you may want "Ground Shipping via" so that the resulting display, when using the AIOS module, the shipping details could be Ground Shipping via Roadway Express.

Link to comment
Share on other sites

  • 1 month later...

Along with the other features I mentioned in the other post please!

An "Edit All" selection. Each USPS and UPS rate increase you have to change the rates, easier to be able to select all. And the ability to sort the rates - be able, for example, drag the appropriate  standard ground below each USPS Parcel (Like you can do with the categories in admin - or something similair):

Sort.PNG.0b820b840c8184796138b4575321d4a5.PNG

 

Link to comment
Share on other sites

  • 1 year later...
  • 11 months later...

Good morning, can anyone give an update to AIOS. The current version is 1.0.16. Has any of the above issues mentioned been added? If so which ones please. 

I am interested in the name change from (All_In_One_Shipping) to a user name as mentioned above.

image.png.89fa87e219838c7c7922cbe7ac61a97b.png

Does the 2018 code by Brian Bsmithers need to be added to version 1.0.16 or has the name change feature been incorportated and I have not found it?

Duncan

Link to comment
Share on other sites

  • 2 months later...

Hi, I gather the main aim of this thread is to ask whether the description field of the shipping service chosen when a customer's shipping rate is calculated by All In One Shipping could be customisable, or at least simplified.

As it stands, the customer is presented with an invoice stating "All_In_One_Shipping:" and then the cost of the service they have chosen.

It would be much better if it simply says “Shipping” instead of “All In One Shipping”, which is superfluous information, and potentially confusing to the customer.

Link to comment
Share on other sites

  • 1 month later...

harris-organic said in the Github #1362:

Quote

Thanks, Brian, you are correct, the conversation requires updating for CC629. I have edited the three files with your code with no luck. ie the code made no difference to the shipping name on the order form.

That's odd.

Is the observed result as seen in an existing order, or in a newly created order?

Specifically, do you see the name in the list of available shipping choices at checkout when the customer is making a purchase?

Link to comment
Share on other sites

Before the changes I would get All_In_One_Shipping on the emailed receipt

image.png.e922687dd619e73f23ebf0bb195c9288.png

 

and after the changes in a newly created order,  I get AIOS without the "under scores" on the emailed receipt.

image.png.f217f27d3b3e3544bc2c66e45ef9be67.png

In the shopping basket, in the drop down menu of Select your shipping method:, the wording after code changes is "All In One Shipping", no underscores.

image.thumb.png.71ec05b2ec6b9f1a5172246f072bb06f.png

I use this line of code in module.definitions.xml

<string name="ship_method_name"><![CDATA[Shipping via]]></string>

I have not seen "Shipping via" in the drop down menu or anywhere else.

 

Link to comment
Share on other sites

The instructions above say to add this:

<string name="ship_method_name"><![CDATA[Name to show as shipping method]]></string>

The "Name to show as shipping method" is NOT an instruction for you to change to whatever desired. This actual phrase will appear on the admin's settings screen for AIOS as a label for the nearby text entry field to inform the admin of the purpose for that field.

Please check if you have these lines of code:
https://github.com/cubecart/v6/commit/30bed42f9bee1e51c5e93fd7c0893a3acfe2cbae

 

Link to comment
Share on other sites

Ahhaa... I now find a place in the AIOS admin setting screen to add a name like " via Australia Post:" And this works on new orders.

However  the lines of code:
https://github.com/cubecart/v6/commit/30bed42f9bee1e51c5e93fd7c0893a3acfe2cbae

are not the same.

My CC629 version of cart.class.php does not have line 936   $shipArray[$module['folder']] = $packages_with_tax;

Link to comment
Share on other sites

The statement you quoted should be in a red-ish color (as seen in the code changes page in the Github), immediately followed by a replacement statement in a green-ish color. You want to see the green-ish colored statement(s) in your code.

 

Link to comment
Share on other sites

  • 1 month later...

The core code was changed in CC612, so upgrading past that will have the needed core code.

Yes, the other shipping modules could/should implement this, for the sake of continuity. However, for a number of the modules, the folder name would suffice: UPS, USPS, AusPost, etc. Thus, not imperative for these modules.

I recall one module that is hard-coded in the core codebase: Per_Category. This poses a problem for translating.

Also, an alternate approach could use the module's language files: "module_title".

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...