Jump to content

Add some links to admin ORDER screen


Recommended Posts

So, I've had this issue since CC3. And I want to fix it in 5. How can I add a couple of links to the admin orders overview screen? Basically, I want a link to PAYPAL and a link to my shipping carrier. What do I need to edit to get this to work?


Here's my story on this.


CC5 is great, but I still am stuck with Paypal and as I understand it, there is no way to fully integrate Paypal into CC. By that, I mean I can not have information from Paypal inserted automatically into the CC orders. For instance Tracking information when shipping through Paypal.


Paypal is my only payment option, so when they pay I use their confirmed address in Paypal to ship. This creates a tracking number in Paypal that I need to manually copy over to the cubecart orders. From there, I used to be able to use Paypal to request carrier pickups, but that link in Paypal is broken so I do that manually now as well. I hate Paypal more and more everyday, but it seems to be the most readily acceptable payment form online.


So some minor tweaks to put an admin at ease is great!



Link to comment
Share on other sites

"Tracking information when shipping through Paypal."


Honestly, I did not know that PayPal offered shipping.


"when they pay I use their confirmed address in Paypal"


The Express Checkout (I think) sends that data back to CC. You don't need to look for it on your PayPal Merchant Account screens.


"This creates a tracking number in Paypal"


So, the customer can choose the shipper, USPS, UPS, FEDEX, whatever? Do you need to set that up in your PayPal Merchant Account control panel?


Should be easy enough to do. One would need a sample of the dataset PayPal sends to CubeCart to locate the tracking number, if it is present.


Essentially, if PayPal sends whatever data item back to CubeCart, it can be processed.

Link to comment
Share on other sites

A link will work until I can root out the data needed. But, yes you can ship through paypal. It's the only way I do it. I have a business account with USPS, UPS, and Fedex, but the store is set up for only USPS priority mail. I create shipping labels and everything through Paypal. It will then generate a tracking number once the label is completed and printed. This is why I wanted to add a shortcut to paypal. I can do it manually for now, just takes a little more time. But in the future, it would be good to find a way to implement this into CC. Because regardless, I believe I still manually have to do this shipping process directly logged in to Paypal.


The link should do just fine for now. Don't have time to add it tonight, but will get on it this week for sure! Thanks!

Link to comment
Share on other sites

  • 4 weeks later...

So, not sure what happened. I did this and had it working. Went to finish an order, and bam! My links are gone, they have disappeared sometime. Not sure if that template file was updated with the latest update, but what the heck! LOL Is there maybe a place I can add these links where they won't disappear again if updated?

Link to comment
Share on other sites

There are several ways an application can be updated. CubeCart uses the "whole-cloth" approach for the codebase, and "differential" for the database and the data in it.


The edit you made to the admin template file orders.index.php is no longer relevant as the complete file was replaced in the upgrade.


There is a place how you can add more tabs to the series of tabs across the top of an admin page, and it will survive across an upgrade.. At present, it is extraordinarily difficult to add or change the content of existing tabs. So, our best shot is to add a new tab.


I will develop some instructions shortly.

Link to comment
Share on other sites

We will be creating a Code Snippet and a dedicated HTML file. The snippet will add a tab to the existing tabs of the Order Summary screen. The HTML file will be the code that has the content to show.


In admin/skins/default/templates/, create a folder named hook_tab_content. Using a programmer's text editor, create a file named helpful_links.html. The content of that file is:

    <div id="helpful_links" class="tab_content">
        <h3>Helpful Links</h3>
            <div><a href="http://www.paypal.com" target="_blank">PayPal</a></div>

This file will be put in the hook_tab_content folder.


Go to admin, Manage Hooks, Code Snippets tab. Enter the following information:

Unique ID: can be anything - try djcaseanova_1

Execution Order: 1

Description: Helpful Links

Trigger: admin.order.index.display

PHP Code:

$smarty_data['hook_tab_content'][] = 'templates/hook_tab_content/helpful_links.html';
$GLOBALS['smarty']->append('HOOK_TAB_CONTENT', $smarty_data['hook_tab_content'], true);
$GLOBALS['main']->addTabControl('Helpful Links', 'helpful_links');

Version: 1.0

Author: DJ


Enable the snippet and click Save.


Keep in mind that the tabs represent sections of one long page of HTML, where javascript is hiding all but the one selected tab.


There is one more section to the HTML that contains the Save button and this section is visible at all times - even on the Helpful Links tab.


Add more links, or whatever else you want, to helpful_links.html.


This new folder and file will not be overwritten or deleted when upgrading. Neither will the snippet - the code is in the database.

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.

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...