Jump to content
boxtel

2gether Discount

Recommended Posts

 

missed in the instructions:

 

in application_top.php add in the big case :

 

case 'buy_tinnx' : if (isset($_GET['products_id'])) {

if (tep_has_product_attributes($_GET['products_id'])) {

tep_redirect(tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $_GET['products_id']));

} else {

if (tep_get_products_stock($_GET['products_id']) > 0) {

$cart->add_cart($_GET['products_id'], $cart->get_quantity($_GET['products_id'])+1);

}

}

}

if (isset($_GET['buy_tinn_add'])) {

if (tep_has_product_attributes($_GET['buy_tinn_add'])) {

tep_redirect(tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $_GET['buy_tinn_add']));

} else {

if (tep_get_products_stock($_GET['buy_tinn_add']) > 0) {

$cart->add_cart($_GET['buy_tinn_add'], $cart->get_quantity($_GET['buy_tinn_add'])+1);

}

}

}

tep_redirect(tep_href_link($goto, tep_get_all_get_params($parameters)));

break;

 

so that both products are added to the basket.


Treasurer MFC

Share this post


Link to post
Share on other sites

in admin, I've just add 2 products.

I've this error:

Fatal error: Call to undefined function: tep_get_products_image() in /web/htdocs/www.100asa.it/home/securecentoasa/2gether.php on line 272

 

and, on catalog, the two small image are missed.


Skype: centoasa

Skype: remigioruberto

Share this post


Link to post
Share on other sites
in admin, I've just add 2 products.

I've this error:

Fatal error: Call to undefined function: tep_get_products_image() in /web/htdocs/www.100asa.it/home/securecentoasa/2gether.php on line 272

 

and, on catalog, the two small image are missed.

 

ah, I thought that was a standard function.

 

1)in admin/includes/functions/general.php add:

 

function tep_get_products_image($product_id) {

$product_query = tep_db_query("select products_image from " . TABLE_PRODUCTS . " where products_id = '" . (int)$product_id . "'");

$product = tep_db_fetch_array($product_query);

return $product['products_image'];

}

 

 

2)in the catalog module change DIR_WS_PRODUCT_IMAGES to DIR_WS_IMAGES

 

I have my product images separated from my normal site images.


Treasurer MFC

Share this post


Link to post
Share on other sites

1st problem:

admin section, when I add a 2gether:

Warning: Missing argument 2 for tep_info_image() in /web/htdocs/www.100asa.it/home/securecentoasa/includes/functions/general.php on line 482

 

2nd problem:

image are too big; insted it's possible to have a little image?

 

ps: how can I do to delete one 2gether offer?


Skype: centoasa

Skype: remigioruberto

Share this post


Link to post
Share on other sites
1st problem:

admin section, when I add a 2gether:

Warning: Missing argument 2 for tep_info_image() in /web/htdocs/www.100asa.it/home/securecentoasa/includes/functions/general.php on line 482

 

2nd problem:

image are too big; insted it's possible to have a little image?

 

ps: how can I do to delete one 2gether offer?

 

 

in admin/includes/functions/general.php:

 

change this :

 

function tep_info_image($image, $alt, $width = '', $height = '') {

 

to this :

 

function tep_info_image($image, $alt = '', $width = '', $height = '') {


Treasurer MFC

Share this post


Link to post
Share on other sites
1st problem:

admin section, when I add a 2gether:

Warning: Missing argument 2 for tep_info_image() in /web/htdocs/www.100asa.it/home/securecentoasa/includes/functions/general.php on line 482

 

2nd problem:

image are too big; insted it's possible to have a little image?

 

ps: how can I do to delete one 2gether offer?

 

2)

 

well, I would recommend a thumbnail contribution but you could change the codes like this :

 

tep_image(DIR_WS_IMAGES . $product_a['products_image'], str_replace('\'','`',$product_a['products_name']))

 

 

to this:

tep_image(DIR_WS_IMAGES . $product_a['products_image'], str_replace('\'','`',$product_a['products_name']), SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT)

 

 

this means adding ", SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT" as parameters to the all tep_image function calls for the products (4)


Treasurer MFC

Share this post


Link to post
Share on other sites
1st problem:

admin section, when I add a 2gether:

Warning: Missing argument 2 for tep_info_image() in /web/htdocs/www.100asa.it/home/securecentoasa/includes/functions/general.php on line 482

 

2nd problem:

image are too big; insted it's possible to have a little image?

 

ps: how can I do to delete one 2gether offer?

 

 

to delete an offer, you either disable it or press the delete button


Treasurer MFC

Share this post


Link to post
Share on other sites

 

 

when you encounter that only 1 product is added, that is caused by the fact that the normal add to cart form is closed way down at the end of the page.

 

solution:

 

look for </form> at the very end of product_info.php and remove it.

 

add </form> just after :

 

<td class="main" align="right"><?php echo tep_draw_hidden_field('products_id', $product_info['products_id']) . tep_image_submit('button_in_cart.gif', IMAGE_BUTTON_IN_CART); ?></td>

<td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>

 

 

that will make sure that the normal add to cart form is closed before the 2gether form is opened.


Treasurer MFC

Share this post


Link to post
Share on other sites
2)

 

well, I would recommend a thumbnail contribution but you could change the codes like this :

 

tep_image(DIR_WS_IMAGES . $product_a['products_image'], str_replace('\'','`',$product_a['products_name']))

to this:

tep_image(DIR_WS_IMAGES . $product_a['products_image'], str_replace('\'','`',$product_a['products_name']), SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT)

this means adding ", SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT" as parameters to the all tep_image function calls for the products (4)

 

what file?

there is not possible to have a little image, as a small picture in product info?


Skype: centoasa

Skype: remigioruberto

Share this post


Link to post
Share on other sites
what file?

there is not possible to have a little image, as a small picture in product info?

 

ofcourse:

 

in includes/modules/2gether.php

 

change:

 

tep_image(DIR_WS_IMAGES . $product_a['products_image'], str_replace('\'','`',$product_a['products_name']))

 

into:

 

tep_image(DIR_WS_IMAGES . $product_a['products_image'], str_replace('\'','`',$product_a['products_name']), SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT)

 

 

change:

 

tep_image(DIR_WS_IMAGES . $product_b['products_image'], str_replace('\'','`',$product_b['products_name']))

 

into:

 

tep_image(DIR_WS_IMAGES . $product_b['products_image'], str_replace('\'','`',$product_b['products_name']), SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT)


Treasurer MFC

Share this post


Link to post
Share on other sites

sorry, what's line of includes/modules/2gether.php?

and also in admin? where?


Skype: centoasa

Skype: remigioruberto

Share this post


Link to post
Share on other sites
when you encounter that only 1 product is added, that is caused by the fact that the normal add to cart form is closed way down at the end of the page.

 

solution:

 

look for </form> at the very end of product_info.php and remove it.

 

add </form> just after :

 

<td class="main" align="right"><?php echo tep_draw_hidden_field('products_id', $product_info['products_id']) . tep_image_submit('button_in_cart.gif', IMAGE_BUTTON_IN_CART); ?></td>

<td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>

that will make sure that the normal add to cart form is closed before the 2gether form is opened.

I still have this problem.

 

i just move the <\form> but still not working, only one product is add

Share this post


Link to post
Share on other sites
I still have this problem.

 

i just move the <\form> but still not working, only one product is add

 

 

my mistake,

 

change this in application_top.php:

 

case 'add_product' : if (isset($HTTP_POST_VARS['products_id']) && is_numeric($HTTP_POST_VARS['products_id'])) {

$cart->add_cart($HTTP_POST_VARS['products_id'], $cart->get_quantity(tep_get_uprid($HTTP_POST_VARS['products_id'], $HTTP_POST_VARS['id']))+1, $HTTP_POST_VARS['id']);

}

tep_redirect(tep_href_link($goto, tep_get_all_get_params($parameters)));

break;

 

 

to this:

 

case 'add_product' : if (isset($_POST['products_id']) && is_numeric($_POST['products_id'])) {

if (tep_get_products_stock($_POST['products_id']) > 0) $cart->add_cart($_POST['products_id'], $cart->get_quantity(tep_get_uprid($_POST['products_id'], $_POST['id']))+1, $_POST['id']);

}

if (isset($_POST['buy_tinn_add']) && is_numeric($_POST['buy_tinn_add'])) {

if (tep_get_products_stock($_POST['buy_tinn_add']) > 0) {

$cart->add_cart($_POST['buy_tinn_add'], $cart->get_quantity(tep_get_uprid($_POST['buy_tinn_add'], $_POST['id']))+1, $_POST['id']);

}

}

tep_redirect(tep_href_link($goto, tep_get_all_get_params($parameters)));

break;

 

 

and remove this:

 

 

 

case 'buy_tinnx' : if (isset($_GET['products_id'])) {

if (tep_has_product_attributes($_GET['products_id'])) {

tep_redirect(tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $_GET['products_id']));

} else {

if (tep_get_products_stock($_GET['products_id']) > 0) {

$cart->add_cart($_GET['products_id'], $cart->get_quantity($_GET['products_id'])+1);

}

}

}

if (isset($_GET['buy_tinn_add'])) {

if (tep_has_product_attributes($_GET['buy_tinn_add'])) {

tep_redirect(tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $_GET['buy_tinn_add']));

} else {

if (tep_get_products_stock($_GET['buy_tinn_add']) > 0) {

$cart->add_cart($_GET['buy_tinn_add'], $cart->get_quantity($_GET['buy_tinn_add'])+1);

}

}

}

tep_redirect(tep_href_link($goto, tep_get_all_get_params($parameters)));

break;

 

that was obsolete.


Treasurer MFC

Share this post


Link to post
Share on other sites

on line 123 and 124 in admin/2gether.php, I've add this:

SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT

to have a small image, but I've small image only when edit offer.

***********

PROBLEM:

the amount of cart is wrong, whit this offer in.

Please try with

http://www.100asa.it/10-anelli-aggiuntivi-...tml?language=it


Skype: centoasa

Skype: remigioruberto

Share this post


Link to post
Share on other sites
on line 123 and 124 in admin/2gether.php, I've add this:

SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT

to have a small image, but I've small image only when edit offer.

***********

PROBLEM:

the amount of cart is wrong, whit this offer in.

Please try with

http://www.100asa.it/10-anelli-aggiuntivi-...tml?language=it

 

PROBLEM: -> read the post just above your post.


Treasurer MFC

Share this post


Link to post
Share on other sites
on line 123 and 124 in admin/2gether.php, I've add this:

SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT

to have a small image, but I've small image only when edit offer.

***********

PROBLEM:

the amount of cart is wrong, whit this offer in.

Please try with

http://www.100asa.it/10-anelli-aggiuntivi-...tml?language=it

 

 

for small images in admin (why?) you can change these lines:

 

tep_info_image(tep_get_products_image($tInfo->product1_id))

 

onto these lines :

 

tep_info_image(tep_get_products_image($tInfo->product1_id),'',SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT)

 

All of them


Treasurer MFC

Share this post


Link to post
Share on other sites

I've already made this change, but the problem remain!


Skype: centoasa

Skype: remigioruberto

Share this post


Link to post
Share on other sites
Image in pop-up don't work!

 

you need to change in includes/modules/2gether.php :

 

tep_href_link(FILENAME_POPUP_IMAGE, 'products_id='

 

into

 

tep_href_link(FILENAME_POPUP_IMAGE, 'pID='


Treasurer MFC

Share this post


Link to post
Share on other sites

Sorry for previous reply!

I'm already made change on line 123 and 124, so you tell on post #18, but I can see little image only when edit offer. I want little image because, sometimes, I've a great image for product, and I spend much time to load a admin page.

For cart problem, I've already made change on post #15, but the problem remain.


Skype: centoasa

Skype: remigioruberto

Share this post


Link to post
Share on other sites

Suggestion: it's possible to have, under the two 2gether products, the price for the signle product, as I see on admin? So my customer can see the real offer and discount.


Skype: centoasa

Skype: remigioruberto

Share this post


Link to post
Share on other sites
Sorry for previous reply!

I'm already made change on line 123 and 124, so you tell on post #18, but I can see little image only when edit offer. I want little image because, sometimes, I've a great image for product, and I spend much time to load a admin page.

For cart problem, I've already made change on post #15, but the problem remain.

 

you cannot put this module inside your "add to cart" form, it has its own form.


Treasurer MFC

Share this post


Link to post
Share on other sites
Suggestion: it's possible to have, under the two 2gether products, the price for the signle product, as I see on admin? So my customer can see the real offer and discount.

 

yes.

 

change :

 

<?php echo '</td><td align="center" width="100px"><img src="images/icon_plus.gif" border="0" style="vertical-align: middle"></td>' .

 

to:

 

<?php echo '<br>'.$currencies->format($product_a['products_price']).'</td><td align="center" width="100px"><img src="images/icon_plus.gif" border="0" style="vertical-align: middle"></td>' .

 

 

change:

 

echo '</td><td width="2%"></td>'.

 

 

to:

 

echo '<br>'.$currencies->format($product_b['products_price']).'</td><td width="2%"></td>'.


Treasurer MFC

Share this post


Link to post
Share on other sites

I have just resolved all problems except one:

 

I can't display the images for the produts in checkout_confirmation.php.

in the properties of the images the link is images/save-icon_sm.gif

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×