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

Duplicate Info From Custom Field

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions
 
Thread Tools Search this Thread
  #1  
Old 03-28-2014, 03:52 PM
  Wazowski's Avatar 
Wazowski Wazowski is offline
 

Advanced Member
  
Join Date: Jan 2011
Posts: 51
 

Exclamation Duplicate Info From Custom Field

Hi there,

I created a custom text field below Detailed Description to make it easier to display different types of information, it all works fine, but when I select a list of products and go to Modify Selected and check my custom field to get saved for all the rest items, it▓s not saving. Where do I missed something?
__________________
X-Cart version 4.5.5
Reply With Quote
  #2  
Old 03-31-2014, 11:47 PM
  totaltec's Avatar 
totaltec totaltec is offline
 

X-Guru
  
Join Date: Jan 2007
Location: Louisville, KY USA
Posts: 5,823
 

Default Re: Duplicate Info From Custom Field

It could be in the template code. Paste your template code Just the section around where you made the change, include the previous field and the following field. I'll take a look.
__________________
Mike White - Now Accepting new clients and projects! Work with the best, get a US based development team for just $125 an hour. Call 1-502-773-6454, email mike at babymonkeystudios.com, or skype b8bym0nkey

XcartGuru
X-cart Tutorials | X-cart 5 Tutorials

Check out the responsive template for X-cart.
Reply With Quote
  #3  
Old 04-01-2014, 10:51 AM
  Wazowski's Avatar 
Wazowski Wazowski is offline
 

Advanced Member
  
Join Date: Jan 2011
Posts: 51
 

Default Re: Duplicate Info From Custom Field

Thanks for your time Mike!

/1/ Created a new column in xcart_products_lng_en mysql table, called custom_text.


/2/ admin/product_modify.php

$trusted_post_variables = array(
'product_lng',
'descr',
'fulldescr',
'posted_data',
'js_code',
'efields',
'custom_text', /** MY CUSTOM FIELD **/
);


/3/ include/product_modify.php

// Fill all languages by default
$int_descr_data = array(
'productid' => $productid,
'product' => $product,
'descr' => $descr,
'fulldescr' => $fulldescr,
'keywords' => $keywords,
'custom_text' /** MY CUSTOM FIELD **/
);

// Update product/descr/fulldescr/keywords
$int_descr_data = array(
'product' => $product,
'descr' => $descr,
'fulldescr' => $fulldescr,
'keywords' => $keywords,
'custom_text' /** MY CUSTOM FIELD **/
);

// Update international descriptions
$int_descr_data = array();
foreach ($query_data as $k => $v) {
if (in_array($k, array('product', 'descr', 'fulldescr', 'keywords', 'custom_text')))

func_unset($query_data, 'product', 'descr', 'fulldescr', 'keywords', 'custom_text');



/4/ include/product_clone.php

// Update just created product by values from existing product
$query = array();
foreach ($product_info as $k=>$v) {
if (
!is_numeric($k)
&& !in_array($k, array('productid', 'productcode', 'provider', 'add_date', 'views_stats', 'del_stats', 'sales_stats', 'product', 'descr', 'fulldescr', 'keywords', 'custom_text'))
) {
$query[$k] = addslashes($v);
}
}


/5/ skin/common_files/main/product_details.tpl

<tr>
{if $geid ne ''}<td width="15" class="TableSubHead"><input type="checkbox" value="Y" name="field[custom_text]" /></td>{/if}
<td colspan="2" class="FormButton">
<div{if $active_modules.HTML_Editor and not $html_editor_disabled} class="description"{/if}>Custom Details 1:</div>
<div class="description-data">
{include file="main/textarea.tpl" name="custom_text" cols=45 rows=12 class="InputWidth" data=$product.custom_text width="100%" btn_rows=4}
</div>
</td>
</tr>
__________________
X-Cart version 4.5.5
Reply With Quote
  #4  
Old 04-05-2014, 04:27 PM
  cherie's Avatar 
cherie cherie is offline
 

X-Wizard
  
Join Date: May 2003
Location: USA
Posts: 1,534
 

Default Re: Duplicate Info From Custom Field

Why not use Extra Fields?
__________________
redlimeweb.com
custom mods and design integration
4.7 linux
Reply With Quote
  #5  
Old 04-07-2014, 10:53 AM
  Wazowski's Avatar 
Wazowski Wazowski is offline
 

Advanced Member
  
Join Date: Jan 2011
Posts: 51
 

Default Re: Duplicate Info From Custom Field

Quote:
Originally Posted by cherie
Why not use Extra Fields?
Limited number of characters (
__________________
X-Cart version 4.5.5
Reply With Quote
  #6  
Old 04-07-2014, 11:19 AM
  cflsystems's Avatar 
cflsystems cflsystems is offline
 

Veteran
  
Join Date: Apr 2007
Posts: 14,197
 

Default Re: Duplicate Info From Custom Field

You have it coded to save for the product itself but not for when it is multiple products. It is in the same product_modify.php and applies for $geid
__________________
Steve Stoyanov
CFLSystems.com
Web Development
Reply With Quote
  #7  
Old 04-07-2014, 11:23 AM
  cherie's Avatar 
cherie cherie is offline
 

X-Wizard
  
Join Date: May 2003
Location: USA
Posts: 1,534
 

Default Re: Duplicate Info From Custom Field

It's far easier to modify Extra Fields to allow more characters than to build your own Extra Fields system.
__________________
redlimeweb.com
custom mods and design integration
4.7 linux
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions



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 12:44 AM.

   

 
X-Cart forums © 2001-2020