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

Support AbanteCart eCommerce

Author Topic: add a link from product to custom form  (Read 371 times)

Offline behold

  • Newbie
  • *
  • Posts: 15
  • Karma: +1/-0
    • View Profile
add a link from product to custom form
« on: August 24, 2017, 08:15:54 AM »
Hello,
I have a product that is a special order item - set to "call to order" which directs the customer to our contact page. I'd like to change the "call to order" link to direct customer to a new custom form.

found this old thread: http://forum.abantecart.com/index.php/topic,4412.msg19286.html#msg19286
but wasn't resolved

Is there a way to do this?

Also, how would I add/load a custom response page/message once the form is submitted?
I've tried adding a new "Content" page. Added the link "thank-you" (with and without /) for the Forms Manager > "Success Page" and upon submitting the form get "The page you requested cannot be found."

even tried putting the full url path for "Success Page" https://...../thank-you

And because the thank you page is a "Content" page - i now have a link in my footer to this page. not desirable. Is there a way to create a new page that is doesn't show up as a link in the footer?

Clearly I'm missing something here - maybe many things :(

Thanks
« Last Edit: August 24, 2017, 09:09:30 PM by cmurphy060960 »

Offline abolabo

  • core-developer
  • Administrator
  • Hero Member
  • *****
  • Posts: 1710
  • Karma: +227/-10
  • web for all, all for web!
    • View Profile
    • AbanteCart
Re: add a link from product to custom form
« Reply #1 on: August 28, 2017, 05:09:22 AM »
to change url for call_to_order you have 2 ways:
1 - do it with hook of your custom extension
Code: [Select]
public function onControllerCommonHead_UpdateData(){
    $this->baseObject->view->assign('call_to_order_url', $this->baseObject->html->getURL('route_to_your_custom/***'));
}
2. Just change this url inside file public_html/storefront/controller/common/head.php

First way better. You will not have troubles after upgrades.

regarding thank-you text.
You should to redirect on your custom page after form submitting and processing.
You can open file public_html/admin/controller/pages/catalog/category.php as example and check method insert. (look below line  if ($this->request->is_POST() && $this->_validateForm()) {)
After data processing you will find redirect there ans success test set ($this->session->data['success'] = $this->language->get('text_success'))
“No one is useless in this world who lightens the burdens of another.”
― Charles Dickens

 

LoliPromDress.com Prom dresses 2018