Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls

Changing the "Ask a question about this product" form

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 04-17-2013, 06:35 AM
  David-Allan's Avatar 
David-Allan David-Allan is offline
 

eXpert
  
Join Date: Oct 2011
Location: Scotland, UK
Posts: 313
 

Default Changing the "Ask a question about this product" form

Hi Everyone,

I'm looking to adjust the "Ask a question about this product" popup page. We use this for people to request a sample and need the popup to have name, address and post code and they must be set to required.

I have found the code for the form and the php that deals with the email but I don't really know how to adjust these.

Has anyone changed this before?

If the worst comes to the worst I could always just make it a link to the contact us page but this won't include the product page that the customer came from.
__________________
Live Version : 4.5.2
Licensed Products:
X-Cart Gold
Ability Theme
CDSEO
xCMS
Abandoned Cart
Food Packaging Scotland
Reply With Quote
  #2  
Old 04-17-2013, 04:49 PM
 
suseela suseela is offline
 

Advanced Member
  
Join Date: Jan 2013
Posts: 55
 

Default Re: Changing the "Ask a question about this product" form

hello, i am using the 2 column design. Home Shopping Cart Contact Us links are at the top just below the search bar. I need to add the sell with us link. Can you tell me the exact tpl i need to edit. Thanks so much for the help.
__________________
www.indiancarnival.com

based on Xcart pro 4.5
Reply With Quote
  #3  
Old 04-18-2013, 12:04 AM
  David-Allan's Avatar 
David-Allan David-Allan is offline
 

eXpert
  
Join Date: Oct 2011
Location: Scotland, UK
Posts: 313
 

Default Re: Changing the "Ask a question about this product" form

Quote:
Originally Posted by suseela
hello, i am using the 2 column design. Home Shopping Cart Contact Us links are at the top just below the search bar. I need to add the sell with us link. Can you tell me the exact tpl i need to edit. Thanks so much for the help.

You don't need to edit any tpl files to add new links to the speedbar. Just click on content then speedbar from the admin control panel and add what you want from there.
__________________
Live Version : 4.5.2
Licensed Products:
X-Cart Gold
Ability Theme
CDSEO
xCMS
Abandoned Cart
Food Packaging Scotland
Reply With Quote
  #4  
Old 04-18-2013, 12:05 AM
  David-Allan's Avatar 
David-Allan David-Allan is offline
 

eXpert
  
Join Date: Oct 2011
Location: Scotland, UK
Posts: 313
 

Default Re: Changing the "Ask a question about this product" form

Anyone? got any ideas on how to edit the ask a question about this product popup?
__________________
Live Version : 4.5.2
Licensed Products:
X-Cart Gold
Ability Theme
CDSEO
xCMS
Abandoned Cart
Food Packaging Scotland
Reply With Quote
  #5  
Old 04-18-2013, 01:12 AM
 
PhilJ PhilJ is offline
 

X-Guru
  
Join Date: Nov 2002
Posts: 4,094
 

Default Re: Changing the "Ask a question about this product" form

ok, I put this together quickly for you... tested and working fine on v4.5.5

1) skin/common_files/customer/main/ask_question.tpl

After...

Code:
<tr> <td class="data-name"><label for="phone">{$lng.lbl_phone}</label></td> <td>&nbsp;</td> <td> <input type="text" name="phone" id="phone" value="" size="30" /> </td> </tr>

Insert...

Code:
{*--------------------------------*} <tr> <td class="data-name"><label for="sample">Request a Sample</label></td> <td>&nbsp;</td> <td> <input type="checkbox" name="sample" id="sample" /> </td> </tr> <tr style="display:none" class="samples"> <td colspan="3"> <div class="field-container"> <div class="data-name"> <label for="product" class="data-required">Product</label> </div> <div class="data-value"> <input type="text" name="product" id="product" value="{$product.product}" style="width:100%" readonly /> </div> </div> </td> </tr> <tr style="display:none" class="samples"> <td colspan="3"> <div class="field-container"> <div class="data-name"> <label for="address" class="data-required">Address</label> <span class="star">*</span> </div> <div class="data-value"> <textarea name="address" id="address" rows="4" style="width:100%"></textarea> </div> </div> </td> </tr> {literal} <script type="text/javascript"> $("input#sample").click(function(){ if($("input#sample").attr('checked')) { $(".samples").fadeIn(); }else{ $(".samples").fadeOut(); } }); </script> {/literal} {*--------------------------------*}


2) In popup_ask.php

After...

Code:
|| empty($_POST['question'])


Insert...

Code:
|| ($_POST['sample'] == "on" && empty($_POST['address'])) // XCARTMODS ADDED


Then after...

Code:
$mail_smarty->assign('product', $product['product']);

Insert...

Code:
$mail_smarty->assign('sample', $_POST['sample']); // XCARTMODS ADDED $mail_smarty->assign('address', $_POST['address']); // XCARTMODS ADDED

Then after...

Code:
$smarty->assign('productid', $productid);

Insert...

Code:
$smarty->assign('product', $product); // XCARTMODS ADDED

3) In skin/common_files/mail/html/ask_question.tpl

After...

Code:
{if $phone} <tr> <td><b>{$lng.lbl_phone}:</b></td> <td>&nbsp;</td> <td>{$phone|escape}</td> </tr> {/if}

Insert...

Code:
{if $sample eq "on"} <tr> <td><b>Sample Requested:</b></td> <td>&nbsp;</td> <td>Yes</td> </tr> <tr> <td><b>Address:</b></td> <td>&nbsp;</td> <td>{$address|escape}</td> </tr> {/if}

4) Do a template cleanup.

Done
__________________
xcartmods.co.uk
Reply With Quote

The following user thanks PhilJ for this useful post:
chamberinternet (09-20-2013)
  #6  
Old 04-18-2013, 01:57 AM
  David-Allan's Avatar 
David-Allan David-Allan is offline
 

eXpert
  
Join Date: Oct 2011
Location: Scotland, UK
Posts: 313
 

Default Re: Changing the "Ask a question about this product" form

I haven't tried this yet Phil but your a superstar, no idea how you can put this together so quickly.

Your a coding genius.

I'll give it a try shortly after I figure out this bloody mysql left join milarky i'm working on arrgghhh drives me mad.
__________________
Live Version : 4.5.2
Licensed Products:
X-Cart Gold
Ability Theme
CDSEO
xCMS
Abandoned Cart
Food Packaging Scotland
Reply With Quote
  #7  
Old 04-18-2013, 02:04 AM
 
PhilJ PhilJ is offline
 

X-Guru
  
Join Date: Nov 2002
Posts: 4,094
 

Default Re: Changing the "Ask a question about this product" form

left joins can be pain, might be able to help, PM me
__________________
xcartmods.co.uk
Reply With Quote
  #8  
Old 04-18-2013, 02:23 AM
  David-Allan's Avatar 
David-Allan David-Allan is offline
 

eXpert
  
Join Date: Oct 2011
Location: Scotland, UK
Posts: 313
 

Default Re: Changing the "Ask a question about this product" form

Phil that works a treat and looks so easy once you know how.

Thank you so much for your help
__________________
Live Version : 4.5.2
Licensed Products:
X-Cart Gold
Ability Theme
CDSEO
xCMS
Abandoned Cart
Food Packaging Scotland
Reply With Quote
  #9  
Old 04-18-2013, 02:43 AM
  David-Allan's Avatar 
David-Allan David-Allan is offline
 

eXpert
  
Join Date: Oct 2011
Location: Scotland, UK
Posts: 313
 

Default Re: Changing the "Ask a question about this product" form

Thanks for the offer Phil i'm basically just trying to export all the products from one particular category in to a SQL or CSV file so I can import them in to a new DB.

I thought i couldn't do this in xcart but I have just found that you can by searching for products and selecting the category and putting nothing else in then just export these results.
__________________
Live Version : 4.5.2
Licensed Products:
X-Cart Gold
Ability Theme
CDSEO
xCMS
Abandoned Cart
Food Packaging Scotland
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -8. The time now is 08:19 AM.

   

 
X-Cart forums © 2001-2020