Please help us to make AbanteCart Ideal Open Source Ecommerce Solution for everyone.

Support AbanteCart eCommerce

Author Topic: Link Call to Order to specific URL - Not contact page  (Read 6203 times)

Offline starfish777

  • Newbie
  • *
  • Posts: 12
  • Karma: +4/-0
    • View Profile
Link Call to Order to specific URL - Not contact page
« on: December 18, 2017, 09:43:26 PM »
I'm trying to figure out how to link the Call to Order icon on the Product listings page to a specific url NOT the contact page.

When you click on a category you are taken to a catalog list of items of items. Let's say one of the items is a Call to Order item (instead of a regular cart item).  I would like the "phone" icon to click to a specific URL outside of the website that host all services.

I have changed the icon in the /Storefront/view/default/template/pages/product/product_listing.tpl  to the calendar icon because I want the customer to be able to book reservations instead of calling.  In this file, the icon has the "#" hastag in the <a href>.  However, even when I change that hashtag to a specific URL, clicking on the icon in the catalog (Product listing page) still sends me to the contact page.

See attachment...

I was looking for the way to redirect the url in the System --> Localization --> Language Definitions. 

But so far, no luck. 

Any help would be greatly appreciated.

Thanks in advance.
« Last Edit: December 18, 2017, 10:22:22 PM by starfish777 »

Offline abolabo

  • core-developer
  • Administrator
  • Hero Member
  • *****
  • Posts: 2046
  • Karma: +318/-13
  • web for all, all for web!
    • View Profile
    • AbanteCart
Re: Link Call to Order to specific URL - Not contact page
« Reply #1 on: December 19, 2017, 05:54:46 AM »
You can find URL in public_html/storefront/controller/common/head.php line 87.
You can try edit it manually, but it will be overridden by upgrade process.
Right way to use hook (of your custom extension).
for example

Code: [Select]
public function onControllerCommonHead_UpdateData() {
     $this->baseObject->view->assign( 'call_to_order_url', $this->baseObject->html->getURL('your/route') );
}
“No one is useless in this world who lightens the burdens of another.”
― Charles Dickens

Offline starfish777

  • Newbie
  • *
  • Posts: 12
  • Karma: +4/-0
    • View Profile
Re: Link Call to Order to specific URL - Not contact page
« Reply #2 on: December 19, 2017, 10:56:24 PM »
Thank you so much abolabo.  For right now I will do the temporary fix. But I'm relatively new to AbanteCart and will have to research how to work with doing custom extensions in AbanteCart. Already it's Light Years better than Magento in my opinion.

Thanks again!

Offline judipeipei

  • Newbie
  • *
  • Posts: 8
  • Karma: +0/-0
    • View Profile
Re: Link Call to Order to specific URL - Not contact page
« Reply #3 on: August 05, 2022, 06:21:29 AM »
I've found the call to order words in head file, but how to edit and make the call to order button link to the url i want? I've tried to put the url in different places, but none worked.

Judy

Offline Basara

  • Administrator
  • Hero Member
  • *****
  • Posts: 5774
  • Karma: +274/-2
    • View Profile
Re: Link Call to Order to specific URL - Not contact page
« Reply #4 on: August 05, 2022, 06:25:07 AM »
Hello.
Replace URL in this code
Code: [Select]
$this->view->assign('call_to_order_url', 'myurl');

Offline judipeipei

  • Newbie
  • *
  • Posts: 8
  • Karma: +0/-0
    • View Profile
Re: Link Call to Order to specific URL - Not contact page
« Reply #5 on: August 09, 2022, 03:30:37 AM »
It's not working, am I doing it wrong?

Offline Basara

  • Administrator
  • Hero Member
  • *****
  • Posts: 5774
  • Karma: +274/-2
    • View Profile
Re: Link Call to Order to specific URL - Not contact page
« Reply #6 on: August 10, 2022, 02:04:28 AM »
It's not working, am I doing it wrong?

Do not put your url to the variable name (call_to_order_url)

 

Powered by SMFPacks Social Login Mod