Jump to content

Grennix's Content

There have been 5 items by Grennix (Search limited from 28-Feb 20)


Sort by                Order  

#9960 Dynamic Tabs

Posted by Grennix on 12 January 2007 - 12:45 PM in v1.x Store Design & Templates

A very useful hack, just what I need. Will this mod be availible soon, or if possible PM the code to me.

Thanks,
Peter



#9732 MOD: Thumbnail,Product info & Delete in Cart Sidebox

Posted by Grennix on 05 January 2007 - 02:29 PM in Third-Party Services

I have tried to fix the AJAX bug with some trial & error and come up with this solution.
I am new to PHP so I don´t know if this is the best solution, but it seems to work, except for recently viewed in emty cart page.
I removed R.W. in the emty cart page. I don´t see the point to show the same parts after emty the cart. I still have the side box R.W.

1. Add the following code in /include/customer/cart_status.php
one line before
extract(fn_calculate_cart_content($cart, $auth, false, false, 'F', false));

$smarty->assign_by_ref('cart_products', $cart['products']);



2. Add the following code in /include/customer/cart.php (around line 54) after
$smarty->assign_by_ref('cart_subtotal', $cart['subtotal']);

		extract(fn_calculate_cart_content($cart, $auth, false, false, 'F', false));
if (!empty($cart_products)) {
foreach($cart_products as $k => $v) {
fn_gather_additional_product_data($cart_products[$k], true);
}
}
$smarty->assign_by_ref('cart_products', $cart_products);


Can someone with PHP knowledge check the added code?
______________
Peter



#10125 Product Codes on order details page?

Posted by Grennix on 17 January 2007 - 02:36 PM in General Questions

Try putting this in order_details.tpl before {$oi.product|escape:html}


{$oi.product_code}  



Peter



#10221 Discussion Module Causing Spam

Posted by Grennix on 19 January 2007 - 02:36 PM in General Questions

My mistake, the mod was for the Send to friend, to stop people to send anonymous mail to other people.

Try this for reviews if that is your problem area.
\customer\addons\discussion\discussion.tpl
1. This mod removes the textbox but not to add reviews.
Add the red code
[COLOR="Red"]{if $auth.user_id}[/COLOR]
{if $discussion.type == 'C' || $discussion.type == 'B'}
<tr>
	<td class="field-name" nowrap="nowrap">{$lang.your_message}: </td>
	<td width="100%">
		<textarea name="post_data[message]" class="input-text" cols="70" rows="10"></textarea></td>
</tr>
{/if}
<tr>
	<td> </td>
	<td>
		{include file="buttons/button.tpl" but_text=$lang.submit but_onclick="javascript: document.add_post_form.submit();"}</td>
[COLOR="Red"]</tr>

{else}
<tr>
	<td class="field-name" nowrap="nowrap">{$lang.your_message}: </td>
	<td class="field-name" nowrap="nowrap">{$lang.error_not_logged_reviews} </td>

</tr>
{/if}[/COLOR]
</table>
</form>
{/if}

{/capture}

2. This mod if remove the possibility to add reviews without to log in.
add the code in red

<br />
[COLOR="red"]{if $auth.user_id}[/COLOR]
{if 'CRB'|strpos:$discussion.type !== false}
{include file="common_templates/subheader.tpl" title=$lang.add_new_post}
<p></p>
<form action="{$index_script}" method="POST" name="add_post_form">
<input type ="hidden" name="{$target_name}" value="discussion" />
<input type ="hidden" name="{$mode_name}" value="add_post" />
<input type ="hidden" name="post_data[thread_id]" value="{$discussion.thread_id}" />
<input type ="hidden" name="redirect_url" value="{$current_url}" />
<input type="hidden" name="selected_section" value="" />

<table cellpadding="2" cellspacing="1" border="0" width="100%">
<tr>
	<td class="field-name" nowrap="nowrap">{$lang.your_name}: </td>
	<td width="100%">
		<input type="text" name="post_data[name]" value="{if $auth.user_id}{$user_info.firstname} {$user_info.lastname}{/if}" size="70" class="input-text" /></td>
</tr>
{if $discussion.type == 'R' || $discussion.type == 'B'}
<tr>
	<td class="field-name" nowrap="nowrap">{$lang.your_rating}: </td>
	<td width="100%">
		<select name="post_data[rating_value]">
		<option value="5" selected="selected">{$lang.excellent}</option>
		<option value="4">{$lang.very_good}</option>
		<option value="3">{$lang.average}</option>
		<option value="2">{$lang.fair}</option>
		<option value="1">{$lang.poor}</option>
		</select></td>
</tr>
{/if}

{if $discussion.type == 'C' || $discussion.type == 'B'}
<tr>
	<td class="field-name" nowrap="nowrap">{$lang.your_message}: </td>
	<td width="100%">
		<textarea name="post_data[message]" class="input-text" cols="70" rows="10"></textarea></td>
</tr>
{/if}
<tr>
	<td> </td>
	<td>
		{include file="buttons/button.tpl" but_text=$lang.submit but_onclick="javascript: document.add_post_form.submit();"}</td>
	
</table>
</form>
{/if}
[COLOR="Red"]{else}
<table cellpadding="2" cellspacing="1" border="0" width="100%">
<tr>
<td nowrap="nowrap" align="center"><b>{$lang.error_not_logged_reviews}</b></td>
</tr>
</table>
{/if}[/COLOR]
{/capture}


You also have to add a language variable to show your message, "error_not_logged_reviews"

It´s probably better to fix it in the admin product page, but this is a quick fix.
It works on my local installed shop.
Peter



#10159 Discussion Module Causing Spam

Posted by Grennix on 17 January 2007 - 11:10 PM in General Questions

Maybe this could be a solution.
Add the code in red to /customer/addons/send_to_friend.tpl

<td nowrap valign="top"><b>{$lang.your_message}:</b></td>
<td class="required-field-mark" valign="top">*</td>
{*Check if customer is allowed to modify email body*}
{if $auth.user_id}
<td>
<textarea class="input-text" rows="5" cols="65" name="send_data[notes]" id="id_send_data_notes">
{$lang.send_to_friend_notice}
{$notes_data|escape:html}</textarea></td>
{else}
<td>
<textarea class="input-text" rows="5" cols="65" readonly wrap="soft" name="send_data[notes]" id="id_send_data_notes">{$lang.send_to_friend_notice}
{$notes_data|escape:html}</textarea></td>
{/if}
</tr>

Add a new language variable {$lang.send_to_friend_notice} and put in the messsage you like to show in the textarea.

You have to be logged in to add text in the message box.

Peter