button images

pete-newbie

No avatar

2005-05-24 20:08

I want to put on image buttons on to the orders pages

<input type='submit' name='dalej' value='$lang[Next] &raquo;' class='submit' />

I am not sure where to put the following code

src='/shop/templates/default/img/next.gif'

I can get the image to appear but the button does'nt work?

Wizzud

No avatar

2005-05-25 08:30

You should use either type='image', which will submit the form (and include x and y co-ordinates), or type='button' with an onclick action specified to submit the form when pressed.

pete-newbie

No avatar

2005-05-25 18:29

Wizzud

I have managed to do the UPDATE button on the Orders Basket.tpl

But cannot get it to parse the page on the NEXT button using

<input type='image' name='dalej' value='$lang[Next] &raquo;'src='/shop/templates/default/img/next.gif' class='submit' alt='Next'/>

Any ideas where I am going wrong?


Many thanks

Wizzud

No avatar

2005-05-26 09:40

First check the spacing between the attributes in your input statement (eg. between value='..' and src='..').
When you hit the Next button, what is happening? Is it getting to the delivery page? Are changes in quantity not being reflected on the delivery page?

pete-newbie

No avatar

2005-05-26 15:47

Wizzud


Have checked all spaces -ok No it does not go to the delivery page it just refreshes the Orders-basket page.
The update button works fine and all other pages work fine with image-buttons, its just the Next button on the orbers_basket page I can't get to work.

I am really confused - Thanks for your help so far

Wizzud

No avatar

2005-05-26 17:51

If you change the quantity then hit Next (without hitting Update!) does the quantity update to the new value when the page is re-displayed?

Assuming you're running locally:

In index.php in the
...
elseif( $p == 'basket' ){
...
section, look for the line

extract( $_POST );

and immediately under it put in the line

var_dump($_POST);

When you next hit Next you should be presented with the contents of the POSTed variables, which should include 'dalej'. Check.
Remove inserted line.

A couple of lines further down, imediately after
...
if( isset( $dalej ) ){
...
insert

echo 'here';

When you next hit Next you should get the text 'here' at the top of the page, followed by a warning about headers being modified. Check.
Remove the inserted line.

NOTE: If you have productAttributes installed then either disable it temporarily, or apply the same change(s) to plugins/productAttributes/actions_client.php.

pete-newbie

No avatar

2005-05-26 19:54

Wizzud

When I change the quantity & hit the next button it does change the quantity without hitting the update button.

I have tried the above tests but do not get any of the results as you state.
I do have product attributes installed, do you think this could be the problem?
I have turned them off in the plugin manager but it makes no difference to the results as you displayed above.

All other pages with image buttons are working fine including the final send order image button on the delivery page ( assuming I go back to the normal add button on orders basket page of course)

Wizzud

No avatar

2005-05-27 09:20

I hate remote debugging!

OK.
Disable productAttributes from plugin manager.
What other plugins do you have installed? - if singleRateTax or taxAndDiscount, disable them too.
Check that Next button still does not work.

In index.php, immediately ABOVE the line

if( $p == 'productsList' ){

insert

echo "p=$p;POST=";var_dump($_POST);echo ";GET=";var_dump($_GET);

and save.

Go into QC and add a product to your basket. You should see the results of the inserted line on each page of QC. You 'may' get a 'cannot modify header...' warning when adding the product - just hit Back button on browser and click 'basket' in top menu, the product should still have been added.

Once in basket,do a View Source and find the HTML for the cell containing the Next button, eg

<td colspan='5' style='padding: 5px; text-align: right;'>
<input type='submit' value='Update' class='submit' />
&nbsp;
<input type='submit' name='dalej' value='Next &raquo;' class='submit' />
</td>

Highlight, copy and capture it.

Now click the Next button, and something like the following should be displayed...

p=basket;POST=array(5) { ["aProduct"]=> array(1) { [0]=> string(1) "1" } ["aElement"]=> array(1) { [0]=> string(1) "8" } ["aQuantityBefore"]=> array(1) { [0]=> string(1) "3" } ["aQuantity"]=> array(1) { [0]=> string(1) "3" } ["dalej"]=> string(6) "Next ť" } ;GET=array(2) { ["p"]=> string(6) "basket" ["akcja"]=> string(6) "zapisz" }
Warning: Cannot modify header information - headers already sent by ....

Highlight, copy and capture it.

Show me results.
Remove inserted line from index.php.

pete-newbie

No avatar

2005-05-27 10:54

Wizzud

Have disabled Attribute plugin, only other I have are sendOrder to Client & Random Product.


<td colspan='5' style='padding: 5px; text-align: right;'>
<input type='image' class='submit' value='Update'src='/shop/templates/default/img/update.gif' alt='Update' />
&nbsp;
<input type='submit' name='dalej' value='Next &raquo;' class='submit' /></td>

is the first result (this is not using a image as a button) so it takes me through to the delivery page with the following header

p=$p;POST=array(0) { } ;GET=array(1) { ["p"]=> string(8) "delivery" }



Using an image as a next button does'nt go anywhere (with the following code

<input type='image' class='submit' value='$lang[Calc]'src='/shop/templates/default/img/update.gif' alt='Update' />
&nbsp;
<input type='image' src='/shop/templates/default/img/next.gif' name='dalej' value='submit' class='submit' /></td>


Many thanks

Wizzud

No avatar

2005-05-27 14:53

Should have asked this earlier - what version of QC you using?

pete-newbie

No avatar

2005-05-27 18:13

V2.5

Wizzud

No avatar

2005-05-29 13:02

In your plugins folder there are 3 php files: actions_client.php, actions_admin.php, and plugins.php. Can you show me their contents, please?

pete-newbie

No avatar

2005-05-29 13:06

Actions Client =

<?php
$sRandomProduct = throwRandomProduct( );
require DIR_PLUGINS.'productAttributes/actions_client.php';
$sBasketSummary = throwBasketSummary( );
require DIR_PLUGINS.'sendOrderToClient/actions_client.php';
?>


Actions Admin =

<?php
require DIR_PLUGINS.'pluginManager/actions_admin.php';
require DIR_PLUGINS.'productAttributes/actions_admin.php';
?>

Plugins =

<?php
require DIR_PLUGINS.'pluginManager/pluginManager.php';
require DIR_PLUGINS.'productAttributes/attributes-'.$config['db_type'].'.php';
require DIR_PLUGINS.'productAttributes/attributes-admin.php';
require DIR_PLUGINS.'productAttributes/attributes.php';
require DIR_PLUGINS.'productAttributes/productAttributes.php';
require DIR_PLUGINS.'randomProduct/randomProduct.php';
require DIR_PLUGINS.'basketSummary/basketSummary.php';
require DIR_PLUGINS.'enhancedSearch/enhancedSearch.php';
?>


Many thanks

wizzud

No avatar

2005-05-30 17:18

RTFM!

For a start.

actions_client.php:
<?php
$sRandomProduct = pluginIsEnabled('randomProduct') ? throwRandomProduct( ) : '';
if (pluginIsEnabled('productAttributes')) require DIR_PLUGINS.'productAttributes/actions_client.php';
$sBasketSummary = pluginIsEnabled('basketSummary') ? throwBasketSummary( ) : '';
if (pluginIsEnabled('sendOrderToClient')) require DIR_PLUGINS.'sendOrderToClient/actions_client.php';
?>

actions_admin.php:
<?php
require DIR_PLUGINS.'pluginManager/actions_admin.php';
if (pluginIsEnabled('productAttributes')) require DIR_PLUGINS.'productAttributes/actions_admin.php';
?>

plugins.php
<?php
require DIR_PLUGINS.'pluginManager/pluginManager.php';
if (pluginIsEnabled('productAttributes')) {
require DIR_PLUGINS.'productAttributes/attributes-'.$config['db_type'].'.php';
require DIR_PLUGINS.'productAttributes/attributes-admin.php';
require DIR_PLUGINS.'productAttributes/attributes.php';
require DIR_PLUGINS.'productAttributes/productAttributes.php';
}
if (pluginIsEnabled('randomProduct')) require DIR_PLUGINS.'randomProduct/randomProduct.php';
if (pluginIsEnabled('basketSummary')) require DIR_PLUGINS.'basketSummary/basketSummary.php';
if (pluginIsEnabled('enhancedSearch')) require DIR_PLUGINS.'enhancedSearch/enhancedSearch.php';
?>

Now when you disable a plugin in plugin manager it will actually be disabled!

Disable productAttributes and try again from 'I hate remote debugging! ....'

pete-newbie

No avatar

2005-05-30 18:35

Sorry wizzud

I have done as instructed and here are the results

<td colspan='5' style='padding: 5px; text-align: right;'>
<input type='submit' value='Update' class='submit' />
&nbsp;
<input type='submit' name='dalej' value='Next &raquo;' class='submit' />
</td>


After clicking next:

p=basket;POST=array(4) { ["aElement"]=> array(1) { [0]=> string(2) "52" } ["aQuantityBefore"]=> array(1) { [0]=> string(1) "1" } ["aQuantity"]=> array(1) { [0]=> string(1) "1" } ["dalej"]=> string(6) "Next ť" } ;GET=array(2) { ["p"]=> string(6) "basket" ["akcja"]=> string(6) "zapisz" }
Warning: Cannot modify header information - headers already sent by (output started at /home/perby1/public_html/shop/index.php:60) in /home/perby1/public_html/shop/index.php on line 138

wizzud

No avatar

2005-06-03 09:44

Sorry for the delay.

Judging by the HTML above, this is the code that works, not the code that doesn't work (although I can't see how it would do a quantity update without a product id, still... ).
Can you repeat but for the code that DOESN'T work?

pete-newbie

No avatar

2005-06-03 14:20

Wizzud

This is diplayed in the header of the orders_basket page

p=basket;POST=array(5) { ["aElement"]=> array(1) { [0]=> string(2) "57" } ["aQuantityBefore"]=> array(1) { [0]=> string(1) "1" } ["aQuantity"]=> array(1) { [0]=> string(1) "2" } ["x"]=> string(2) "24" ["y"]=> string(1) "9" } ;GET=array(2) { ["p"]=> string(6) "basket" ["akcja"]=> string(6) "zapisz" }
Notice: Undefined offset: 0 in /home/perby1/public_html/shop/index.php on line 135


and this is the source html

<td colspan='5' style='padding: 5px; text-align: right;'>
<input type='image' value='$lang[Calc]' src='/shop/templates/default/img/update.gif' alt='update' class='submit' />
&nbsp;
<input type='image' value='Next&raquo;'name='dalej' src='/shop/templates/default/img/next.gif' alt='Next' class='submit' />
</td>

Have also tried value='submit' but no difference


can't show you the next page as that is as far as it will go


Thanks

pete-newbie

No avatar

2005-06-15 08:43

wizzud - i am still strugggling with this one??????

wizzud

No avatar

2005-06-15 09:09

The name of your Next button ('dalej') doesn't appear to be getting POSTed. Make sure there is a space in front of the name attribute, because there doesn't appear to be from the HTML code you have pasted above.
I can't see anything else that would cause it not to work.

pete-newbie

No avatar

2005-06-15 18:14

Tried the above no difference - I have now given up, good luck to any one else who can fix this problem? :-(

Back to top
about us | contact