Jump to content

  • You cannot start a new topic
  • You cannot reply to this topic

Custom Add On for products has broken save button Rate Topic   - - - - -

 
  • jwal1776
  • Junior Member
  • Members
  • Join Date: 15-Nov 10
  • 13 posts

Posted 15 May 2012 - 03:46 PM #1

I had a custom add on called 'price_group' developed about 2 years ago that, after an update has broken the save and save and close buttons on the product edit screen. Unfortunately, the developer has gone MIA.

I think this might be easy to solve, though, I'm just not there yet so I was seeing if anyone had any tips for me. I noticed that when I added '
{capture name="mailbox"}
' to the update.tpl file in the /skins/basic/addons/price_group/views/price_group/ directory, both the add-on and the save buttons began working, but the tabs such as images, secondary categories, etc. was pushed to the very bottom of the product edit page.

My code for the file in /skins/basic/addons/price_group/views/price_group/update.tpl is as follows:

{capture name="mainbox"}
{assign var="id" value=$price_group_id|default:0}
<div id="content_group_product_price_group_{$id}">
<form action="{""|fn_url}" method="post" name="price_group_form_00" class="form-highlight" enctype="multipart/form-data">
</form>
<form action="{""|fn_url}" method="post" name="price_group_form_{$id}" class="form-highlight" enctype="multipart/form-data">
<input type="hidden" name="price_group_id" value="{$id}" />
{if $smarty.request.product_id}
{if !$price_group_data}
<input type="hidden" name="price_group_data[product_id]" value="{$smarty.request.product_id}" />
{/if}
<input type="hidden" name="product_id" value="{$smarty.request.product_id}" />
{/if}
<div class="object-container">
<div class="tabs cm-j-tabs">
<ul>
  <li id="tab_price_group_details_{$id}" class="cm-js cm-active"><a>{$lang.general}</a></li>
  <li id="tab_price_group_variants_{$id}" class="cm-js"><a>{$lang.variants}</a></li>
</ul>
</div>
<div class="cm-tabs-content" id="tabs_content_{$id}">
<div id="content_tab_price_group_details_{$id}">
<fieldset>
  <div class="form-field">
   <label for="name_{$id}" class="cm-required">{$lang.name}:</label>
   <input type="text" name="price_group_data[name]" id="name_{$id}" value="{$price_group_data.name}" class="input-text-large main-input" />
  </div>
  <div class="form-field">
   <label for="column1_{$id}">{$lang.column1}:</label>
   <input type="text" name="price_group_data[column1]" id="column1_{$id}" value="{$price_group_data.column1}" class="input-text-medium" />
  </div>
  <div class="form-field">
   <label for="column1_{$id}">{$lang.column2}:</label>
   <input type="text" name="price_group_data[column2]" id="column2_{$id}" value="{$price_group_data.column2}" class="input-text-medium" />
  </div>
  <div class="form-field">
   <label for="column1_{$id}">{$lang.column3}:</label>
   <input type="text" name="price_group_data[column3]" id="column3_{$id}" value="{$price_group_data.column3}" class="input-text-medium" />
  </div>
  <div class="form-field">
   <label for="column1_{$id}">{$lang.column4}:</label>
   <input type="text" name="price_group_data[column4]" id="column4_{$id}" value="{$price_group_data.column4}" class="input-text-medium" />
  </div>
  <div class="form-field">
   <label for="column1_{$id}">{$lang.column5}:</label>
   <input type="text" name="price_group_data[column5]" id="column5_{$id}" value="{$price_group_data.column5}" class="input-text-medium" />
  </div>
  <div class="form-field">
   <label for="column1_{$id}">{$lang.column6}:</label>
   <input type="text" name="price_group_data[column6]" id="column6_{$id}" value="{$price_group_data.column6}" class="input-text-medium" />
  </div>
		<fieldset>
<!--content_tab_price_group_details_{$id}--></div>
  <div class="hidden" id="content_tab_price_group_variants_{$id}">
  <fieldset>
  <table cellpadding="0" cellspacing="0" class="table">
  <tbody>
  <tr class="first-sibling">
   <th class="cm-non-cb">{$lang.position_short}</th>
						<th class="cm-non-cb">{$lang.name}</th>
   <th class="cm-non-cb">{$lang.column1}</th>
						<th class="cm-non-cb">{$lang.column2}</th>
						<th class="cm-non-cb">{$lang.column3}</th>
						<th class="cm-non-cb">{$lang.column4}</th>
						<th class="cm-non-cb">{$lang.column5}</th>
						<th class="cm-non-cb">{$lang.column6}</th>
   <th class="cm-non-cb">&nbsp;</th>
  </tr>
  </tbody>
  {foreach from=$price_group_data.values item="vr" name="fe_v"}
  {assign var="num" value=$smarty.foreach.fe_v.iteration}
  <tbody class="hover cm-row-item" id="price_group_variants_{$id}_{$num}">
  <tr>
   <td class="cm-non-cb">
	<input type="text" name="price_group_data[values][{$num}][position]" value="{$vr.position}" size="3" class="input-text-short" /></td>
					  
   <td class="cm-non-cb">
	<input type="text" name="price_group_data[values][{$num}][name]" value="{$vr.name}" class="input-text-medium main-input" style="width: 110px;" /></td>
					  
   <td class="cm-non-cb">
	<input type="text" name="price_group_data[values][{$num}][column1]" value="{$vr.column1}" class="input-text-medium main-input" style="width: 80px;" /></td>
					  
   <td class="cm-non-cb">
	<input type="text" name="price_group_data[values][{$num}][column2]" value="{$vr.column2}" class="input-text-medium main-input" style="width: 80px;" /></td>
					  
   <td class="cm-non-cb">
	<input type="text" name="price_group_data[values][{$num}][column3]" value="{$vr.column3}" class="input-text-medium main-input" style="width: 80px;" /></td>
					  
   <td class="cm-non-cb">
	<input type="text" name="price_group_data[values][{$num}][column4]" value="{$vr.column4}" class="input-text-medium main-input" style="width: 80px;" /></td>
					  
   <td class="cm-non-cb">
	<input type="text" name="price_group_data[values][{$num}][column5]" value="{$vr.column5}" class="input-text-medium main-input" style="width: 80px;" /></td>
					  
   <td class="cm-non-cb">
	<input type="text" name="price_group_data[values][{$num}][column6]" value="{$vr.column6}" class="input-text-medium main-input" style="width: 80px;" /></td>
	<td class="right cm-non-cb{if $option_data.option_type == "C"} hidden{/if}">
	{include file="buttons/multiple_buttons.tpl" item_id="option_variants_`$id`_`$num`" tag_level="3" only_delete="Y"}
   </td>
  </tr>
  </tbody>
  {/foreach}
  {math equation="x + 1" assign="num" x=$num|default:0}{assign var="vr" value=""}
  <tbody class="hover cm-row-item" id="box_add_variant_{$id}">
  <tr>
   <td class="cm-non-cb">
	<input type="text" name="price_group_data[values][{$num}][position]" value="" size="3" class="input-text-short main-input" /></td>
					  
						<td class="cm-non-cb">
	<input type="text" name="price_group_data[values][{$num}][name]" value="" class="input-text-short main-input" style="width: 110px;" /></td>
					  
					  
   <td class="cm-non-cb">
	<input type="text" name="price_group_data[values][{$num}][column1]" value="" class="input-text-short main-input" style="width: 80px;" /></td>
   <td class="cm-non-cb">
	<input type="text" name="price_group_data[values][{$num}][column2]" value="" class="input-text-short main-input" style="width: 80px;" /></td>
   <td class="cm-non-cb">
	<input type="text" name="price_group_data[values][{$num}][column3]" value="" class="input-text-short main-input" style="width: 80px;" /></td>
   <td class="cm-non-cb">
	<input type="text" name="price_group_data[values][{$num}][column4]" value="" class="input-text-short main-input" style="width: 80px;" /></td>
   <td class="cm-non-cb">
	<input type="text" name="price_group_data[values][{$num}][column5]" value="" class="input-text-short main-input" style="width: 80px;" /></td>
   <td class="cm-non-cb">
	<input type="text" name="price_group_data[values][{$num}][column6]" value="" class="input-text-short main-input" style="width: 80px;" /></td>
   <td class="right cm-non-cb">
	{include file="buttons/multiple_buttons.tpl" item_id="add_variant_`$id`" tag_level="2"}
   </td>
  </tr>
  </tbody>
  </table>
</fieldset>
<!--content_tab_price_group_variants_{$id}--></div>
</div>
</div>
<div class="buttons-container">
{if $mode == "add"}
  {assign var="_but_text" value=$lang.create}
				{include file="buttons/save_cancel.tpl" but_text=$_but_text but_name="dispatch[price_group.add]" cancel_action="close" extra=""}
{else}
  {if "COMPANY_ID"|defined &&  $option_data.option_id && $option_data.company_id != $smarty.const.COMPANY_ID}
   {assign var="hide_first_button" value=true}
  {/if}
  {assign var="_but_text" value=""}
				{include file="buttons/save_cancel.tpl" but_text=$_but_text but_name="dispatch[price_group.update]" cancel_action="close" extra="" hide_first_button=$hide_first_button}
{/if}
</div>
</form>
<!--content_group_product_price_group_{$id}--></div>


And my code for /skins/basic/addons/price_group/hooks/products/tab_content.post.tpl is:

{* http://cs-cart-development.com *}
{capture name="mainbox_price_group"}
<div id="content_price_group" class="cm-hide-save-button hidden">
{script src="js/tabs.js"}
{script src="js/picker.js"}

{assign var="rev_delete_id" value="price_groups_list"}
{assign var="query_product_id" value="&product_id=`$product_id`"}
<div class="items-container" id="price_groups_list">
{foreach from=$price_group_list_data item="po"}

{assign var="po_name" value=$po.name}
{assign var="link_text" value=$lang.edit}
{assign var="additional_class" value="cm-no-hide-input"}
{assign var="link_class" value="text-button-edit"}
	  
{capture name="edit_picker"}
  {include file="addons/price_group/views/price_group/update.tpl" price_group_id=$po.price_group_id price_group_data=$po.data}
{/capture}
{include file="common_templates/object_group.tpl" id=$po.price_group_id text=$po_name status=$po.status href="" object_id_name="price_group_id" table="price_group" href_delete="price_group.delete?price_group_id=`$po.price_group_id``$query_product_id`" rev_delete="price_groups_list" header_text="Editing price group: `$po_name`" content=$smarty.capture.edit_picker}
{foreachelse}
<p class="no-items">{$lang.no_items}</p>
{/foreach}
<!--price_groups_list--></div>
<div class="buttons-container">
{capture name="tools"}
  {capture name="add_new_picker"}
   {include file="addons/price_group/views/price_group/update.tpl" mode="add" price_group_id="0"}
  {/capture}
  {include file="common_templates/popupbox.tpl" id="add_new_price_group" text=$lang.price_group link_text=$lang.add_price_group act="general" content=$smarty.capture.add_new_picker}
{/capture}
{$smarty.capture.tools}
</div>
{/capture}

{$smarty.capture.mainbox_price_group}
<!--content_price_group--></div>


I feel like I'm close but I'm missing something simple. Anyone have any pointers/ideas?

 
  • jwal1776
  • Junior Member
  • Members
  • Join Date: 15-Nov 10
  • 13 posts

Posted 15 May 2012 - 04:07 PM #2

Also, if this is in the wrong forum category, mods please move to the appropriate one. I wasn't sure.