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)
-   -   Setting Product defaults in admin (https://forum.x-cart.com/showthread.php?t=64728)

smarta 08-30-2012 04:33 PM

Setting Product defaults in admin
 
does anyone know how to change the default settings for a "new product"?

eg all my new products default to

Free Shipping |No|

I want to change it so the default is

Free Shipping |Yes|

this will save me changing it each time

there are a few other defaults I would like to change too - so if someone knows ...?

totaltec 08-30-2012 04:56 PM

Re: Setting Product defaults in admin
 
You would do this by editing the template for that page. Use webmaster mode to discover the template, then simply change the default value. I am now contemplating a tutorial on this, it is such a commonly needed feature.

smarta 08-30-2012 05:19 PM

Re: Setting Product defaults in admin
 
great thanks

i edited
: /common_files/main/product_details.tpl

and swapped the order of the yes & no options and that changed the default

ie

<tr>
{if $geid ne ''}<td width="15" class="TableSubHead"><input type="checkbox" value="Y" name="fields[free_shipping]" /></td>{/if}
<td class="FormButton" nowrap="nowrap">{$lng.lbl_free_shipping}:</td>
<td class="ProductDetails">
<select name="free_shipping">
<option value='N'{if $product.free_shipping eq 'N'} selected="selected"{/if}>{$lng.lbl_no}</option>
<option value='Y'{if $product.free_shipping eq 'Y'} selected="selected"{/if}>{$lng.lbl_yes}</option>
</select>
</td>
</tr>

to

<tr>
{if $geid ne ''}<td width="15" class="TableSubHead"><input type="checkbox" value="Y" name="fields[free_shipping]" /></td>{/if}
<td class="FormButton" nowrap="nowrap">{$lng.lbl_free_shipping}:</td>
<td class="ProductDetails">
<select name="free_shipping">
<option value='Y'{if $product.free_shipping eq 'Y'} selected="selected"{/if}>{$lng.lbl_yes}</option>
<option value='N'{if $product.free_shipping eq 'N'} selected="selected"{/if}>{$lng.lbl_no}</option>

</select>
</td>
</tr>

smarta 08-30-2012 05:34 PM

Re: Setting Product defaults in admin
 
I managed to chnage all I wanted to except for the Clean URL checkbox

as many products will be adde3d as "clones" I want the default to be that it makes the new name the new clean url

I have found a few lines that relte to it - but unsure how to chnge the chckbox to being "not ticked"

this on line 124

Quote:

</tr>

{include file="main/clean_url_field.tpl" clean_url=$product.clean_url clean_urls_history=$product.clean_urls_history clean_url_fill_error=$top_message.clean_url_fill_e rror tooltip_id='clean_url_tooltip_link'}

<tr>

and this on line 434

{if $new_product ne "1" and $geid eq ''}
<br />
{include file="main/clean_urls.tpl" resource_name="productid" resource_id=$productid clean_url_action="product_modify.php" clean_urls_history_mode="clean_urls_history" clean_urls_history=$product.clean_urls_history}
{/if}


All times are GMT -8. The time now is 01:06 PM.

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