X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Changing design (https://forum.x-cart.com/forumdisplay.php?f=51)
-   -   Option Type Custom Text Field (https://forum.x-cart.com/showthread.php?t=64295)

photo 07-14-2012 06:01 AM

Option Type Custom Text Field
 
Hello,

I have added the following option to a product,

Option group name: OrderNumber
Option text: Order Number
Option group type: Custom text field
OrderBy: 1
Availability: Enabled
Options list: This type of product options has no variants

But when I am on the product details page the option does not show up so am unable to enter the order number in the text field. When proceeding to the the cart page it shows,

Selected options:
OrderNumber:

and the only way to add the order number at that point is to click on the Edit options link, insert the order number and click Update.

Why is the option not showing up on the product details page with the text box to be able to insert the order number there?

Thanks

cflsystems 07-14-2012 08:29 AM

Re: Option Type Custom Text Field
 
The only thing comes to mind is you have modified product.tpl file and options are hidden there

photo 07-14-2012 08:54 AM

Re: Option Type Custom Text Field
 
Quote:

Originally Posted by cflsystems
The only thing comes to mind is you have modified product.tpl file and options are hidden there


Thanks Steve,
Yeah I was thinking the same thing as I have had product.tpl extensively modified.
Just had a quick look at it and seen that the following line was commented out.

Code:

{* include file="modules/Product_Options/customer_options.tpl"*}

Not sure why that would have been commented out but will have to investigate when I have more time.

photo 07-14-2012 10:29 AM

Re: Option Type Custom Text Field
 
Steve,

I found out the reason that line was commented out, it is because of the way we have variants in a table.
Would you know what the if statement would be to show it only on that product?
The product page is product.php?productid=45&cat=15 so I would need something along the lines of.

{if product="productid=45&cat=15"}
{include file="modules/Product_Options/customer_options.tpl"}
{/if}

Thanks

cflsystems 07-14-2012 10:43 AM

Re: Option Type Custom Text Field
 
{if $product.productid eq 45}
show it
{else}
show something else}
{/if}

There's no need to cat as productid is unique

photo 07-14-2012 10:56 AM

Re: Option Type Custom Text Field
 
That worked like a champ Steve, thank you.

gotpump 09-15-2012 04:42 PM

Re: Option Type Custom Text Field
 
Does anyone know the code for forcing an entry in a custom text field?

I have the code for forcing a selection from drop downs like

Code:

if (document.getElementById('po447').selectedIndex == 0)
{ alert('Please select a Liner Pattern'); return false;
}
else return true;


But how do I do it for a custom text field?

totaltec 09-16-2012 06:10 AM

Re: Option Type Custom Text Field
 
Try
Code:

if (document.getElementById('po447').value == null || document.getElementById('po447').value == '')
{ alert('Please enter a value'); return false;}
else return true;



All times are GMT -8. The time now is 02:08 PM.

Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.