Jump to content

Recommended Posts

Hi

I need to add the code below to a PHP file but can't get it right.

[code]
<b>Your Cart Contains</b><br>

<a class="infoBoxContents" href=<?=tep_href_link('shopping_cart.php')?>><?=$cart->count_contents()?> items<br>

Sub Total: <?= $currencies->format($cart->show_total())?>

[/code]

I have been trying to add it to the code below

[code]
<td class="infoBoxContents">

<?php

    $info_box_contents = array();
    $info_box_contents[] = array('text' => BOX_HEADING_CART_TOTAL);

    new infoBoxHeading($info_box_contents, false, true, tep_href_link(FILENAME_CART_TOTAL));


<--CODE NEEDS TO GO HERE-->

           new infoBox($info_box_contents);   
           
   ?>     
       </td>

[/code]

Any help would be great, even if your not sure as it might get my brain in gear  ;D


Cheers Richard
Link to comment
https://forums.phpfreaks.com/topic/34073-code-help/
Share on other sites

Your post is vague and impossible to understand as you did not make your question clear to me it just looks like incomplete code with html comments that would cause an error. So I am going to assume you wanted people to help you put code there??

There is not enough code there for people to fill in the blanks. If you have problems writing code paste posts asking for help on the errors but dont ask people to fill in the blanks
Link to comment
https://forums.phpfreaks.com/topic/34073-code-help/#findComment-160215
Share on other sites

Hi

Sorry that the post is vague (i didn't realise) as i don't understand PHP etc and thought this was the place to ask. Had i realised that i should learn PHP before posting, i would have  :-\

But as with the code above it works fine, but dosn't work when i put the following:

<--code start-->
 
        new infoBox($info_box_contents); 
         
  ?>   

<--code end-->


after the html statement.

I'm sorry if this isn't complete code (but it's all i've got) and if so just tell me and i'll go away and try and figure it out myself or try another help forum.

Cheers Richard
Link to comment
https://forums.phpfreaks.com/topic/34073-code-help/#findComment-160411
Share on other sites

Yes understood - BUT seeing that i'm not a php coder, i didn't know it was incomplete, and being told it's incomplete code with no further explanation is a bit of a piss take of an answer. Surely it would be better to stay quiet.

BUT having looked at the code and TRIED a few things i now realise that the following code might be required:

[code]

           $info_box_contents = array();
    $info_box_contents[] = array('align' => 'left',
                                 'text' => ' SOME CODE HERE? ');

[/code]

So it would now look like this:

[code]
<td class="infoBoxContents">

<?php

    $info_box_contents = array();
    $info_box_contents[] = array('text' => BOX_HEADING_CART_TOTAL);

    new infoBoxHeading($info_box_contents, false, true, tep_href_link(FILENAME_CART_TOTAL));

    $info_box_contents = array();
    $info_box_contents[] = array('align' => 'left',
                                 'text' => ' THE CODE NEEDS TO GO HERE? ');


           new infoBox($info_box_contents);   
           
   ?>     
       </td>

[/code]

And "THE CODE NEEDS TO GO HERE?" is as below:


[code]
Your Cart Contains

<a class="infoBoxContents" href=<?=tep_href_link('shopping_cart.php')?>><?=$cart->count_contents()?> items

Sub Total: <?= $currencies->format($cart->show_total())?>

[/code]

Hope that is now MORE complete, but as i stated before, i'm not a php coder so it might not be.

Cheers Richard
Link to comment
https://forums.phpfreaks.com/topic/34073-code-help/#findComment-160447
Share on other sites

So can you tell me why the code is incomplete to you. And if so why is it incomplete?

All the code above does is create a box with a border around it, don't ask me how i don't know, but i do know that the code required is complete on the above page to complete the task.

This code:

[code]
<td class="infoBoxContents">

<?php

    $info_box_contents = array();
    $info_box_contents[] = array('text' => BOX_HEADING_CART_TOTAL);

    new infoBoxHeading($info_box_contents, false, true, tep_href_link(FILENAME_CART_TOTAL));
   
    $info_box_contents = array();
    $info_box_contents[] = array('align' => 'left',
                                 'text' => '<a class="infoBoxContents">items<br></a>');

           new infoBox($info_box_contents);   
           
   ?>     
            </td>
[/code]

is creating the box (Heading "Cart Total") in the right hand column at: http://www.southcoastpetsupplies.co.uk/catalog/index.php

So i just need to input the code in that.

Cheers Richard
Link to comment
https://forums.phpfreaks.com/topic/34073-code-help/#findComment-160462
Share on other sites

in your first post, you provide two bits of code. the bit that draws the box, and the bit of code that you say should go in it. what exactly happens when you actually put the said code into the other code?

[b]edit[/b]: PS, if you wrap your code that you post here in [ code] [ /code] tags (without the spaces), it'll make things a little easier for us to read. cheers
Link to comment
https://forums.phpfreaks.com/topic/34073-code-help/#findComment-160467
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.