Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Adding text to the shopping cart page


Guest

Recommended Posts

I am a bit stuck. I don't know php but I thought I'd figured out what I had to do from looking at the files. I am trying to add some text to the bottom of the shopping cart to say:

 

'Please note that due to high bank charges we are unable to accept orders of less than ?1. All such orders will be subject to a ?1 administration fee. We apologise for any inconvenience.'

 

I went to catalog/shopping_cart.php and added:

 

<tr>

<td align="center" class="main"><br><?php echo LOW_ORDER_FEE; ?></td>

</tr>

 

 

Then I went to catalog/includes/languages/english/shopping_cart.php and put:

 

define('LOW_ORDER_FEE', 'Please note that due to high bank charges we are unable to accept orders of less than ?1. All such orders will be subject to a ?1 administration fee. We apologise for any inconvenience.');

 

But it didn't work. Nothing comes up at all. Why? What did I do wrong? Or didn't do that I should have?

Link to comment
Share on other sites

Where did you add it? Try replacing LOW_ORDER_FEE in the echo with 'Low Order Fee'. If it still doesn't print anything, then you are probably adding it inside a branch where it is not going (e.g. an if with a false condition).

 

Hth,

Matt

Link to comment
Share on other sites

I added it below the buttons. I really wanted it above the buttons but I didn't know where to put it so I settled for below as I thought I could figure out where to put it then.

 

The whole last section now looks like this:

<td class="main"><?php echo '<a href="' . tep_href_link($navigation->path[$back]['page'], tep_array_to_string($navigation->path[$back]['get'], array('action')), $navigation->path[$back]['mode']) . '">' . tep_image_button('button_continue_shopping.gif', IMAGE_BUTTON_CONTINUE_SHOPPING) . '</a>'; ?></td>

<?php

   }

?>

           <td align="right" class="main"><a href="<?php echo tep_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL'); ?>"><?php echo tep_image_button('button_checkout.gif', IMAGE_BUTTON_CHECKOUT); ?></a></td>

         </tr>

       </table></form></td>

     </tr>

<?php

 } else {

?>

     <tr>

       <td align="center" class="main"><?php echo TEXT_CART_EMPTY; ?></td>

     </tr>

     <tr>

       <td align="right" class="main"><br><a href="<?php echo tep_href_link(FILENAME_DEFAULT); ?>"><?php echo tep_image_button('button_continue.gif', IMAGE_BUTTON_CONTINUE); ?></a></td>

     </tr>

<tr>

       <td align="center" class="main"><br><?php echo LOW_ORDER_FEE; ?></td>

     </tr>

<?php

 }

?>

   </table></td>

<!-- body_text_eof //-->

   <td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="0" cellpadding="2">

<!-- right_navigation //-->

<?php require(DIR_WS_INCLUDES . 'column_right.php'); ?>

<!-- right_navigation_eof //-->

   </table></td>

 </tr>

</table>

<!-- body_eof //-->



<!-- footer //-->

<?php require(DIR_WS_INCLUDES . 'footer.php'); ?>

<!-- footer_eof //-->

<br>

</body>

</html>

<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>

 

I'm sure you're right I that I've just put it in the wrong place but I don't know enough to know where to put it.

 

If I have put it in the wrong place do you think you could tell me where it needs to go as it does need to be there. I could put it on the front page but I don't want to put it there as they need to know why extra money has been added to the total.

 

TIA

Link to comment
Share on other sites

Move it after the

<?php

 }

?>

that it is before now. The } closes out the else, so it will only show when the if is false now.

 

Hth,

Matt

Link to comment
Share on other sites

It worked!!

 

Thank you thank you thank you!!

 

*gives Matt a big hug and a kiss and then :oops: *

 

;)

 

It must be good to know how to do all of this complicated stuff.

Link to comment
Share on other sites

I now would like a little more help with this one.

 

I want to display the text only if the subtotal is less than ?1. So if a customer orders more than ?1 (which hopefully most of them will) they never need to know about it.

 

So something like IF $SUBTOTAL <1 THEN PRINT (OK I learned BASIC about a million years ago)

 

But fancied up into php, whatever it should be.

 

Any ideas on what I should put?

Link to comment
Share on other sites

<?php 

 if ($cart->total < 1.00) {

?>

     <tr> 

       <td align="center" class="main"><br><?php echo LOW_ORDER_FEE; ?></td> 

     </tr> 

<?php

 }

?>

would be the syntax. I'm not sure if $cart->total is correct or not.

 

Hth,

Matt

Link to comment
Share on other sites

Thanks for the syntax. I can remember about enough BASIC to make the screen scroll "I am ace" with flashing background, which is what I used to do when I was 10!! I used to be able to program my old BBC B to play music in three part harmony, but that was a long time ago now.

 

Might it be subtotal?

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...