Jump to content

[SOLVED] Simple fix part 2


emediastudios

Recommended Posts

I recently had someone fix this code up for me to show prices if logged in and not to if not logged in.

Works like a charm.

 

<?php

 

if(modApiFunc('Customer_Account','getCurrentSignedCustomer') !== null) {

    ProductSalePrice();

}else{

  echo"<A HREF=\""; PageURL('CustomerSignIn');

  echo"\">Sign In</A> | <A HREF=\""; PageURL('CustomerSignIn');

  echo"\">Register</A>";

}

 

?>

 

What i need now is to replace the ProductSalePrice(); to show the add to cart button if logged in and the the lower part of the code if not, register sign in.

 

the add to cart button is as follows.

 

 

                    <!-- Add to Cart Button -->

                    <TD align="left">

                        <IMG SRC="images/add_to_cart_button.gif" WIDTH="96" HEIGHT="18" BORDER=0 ALT="" onClick="<?php Local_ProductAddToCart(); ?>" style="cursor: pointer;">

                    </TD>

 

Thanks for any help, this has to be my last issue with this site.

 

Link to comment
Share on other sites

You just want to add the add to cart button under the price function?

 


<?php

if(modApiFunc('Customer_Account','getCurrentSignedCustomer') !== null) {

    ProductSalePrice();
    echo "<p>";
    echo "<IMG SRC=\"images/add_to_cart_button.gif\" WIDTH=\"96\" HEIGHT=\"18\" BORDER=0 ALT=\"\" onClick=\"".Local_ProductAddToCart()."\" style=\"cursor: pointer;\">";
}else{
   echo"<A HREF=\""; PageURL('CustomerSignIn');
   echo"\">Sign In</A> | <A HREF=\""; PageURL('CustomerSignIn');
   echo"\">Register</A>";
}

?>



 

 

Not sure if that will work since I can not test it, let me know if it helps out any.

Link to comment
Share on other sites

here is the site link

http://extremehairextensions.com.au/store/product-info.php?pid80.html

at the bottom is at to cart button.

 

The code half works, (on localhost testing, overwrite site file when workind), it shows the sign in - register if not signed in but shows    $54.95

 

javascript: ProductFormSubmit_36(); if signed in, your getting there ;)

Link to comment
Share on other sites

I altered you code a little

     

 <?php

if(modApiFunc('Customer_Account','getCurrentSignedCustomer') !== null) {
   
    echo "<IMG SRC=\"images/add_to_cart_button.gif\" WIDTH=\"96\" HEIGHT=\"18\" BORDER=0 ALT=\"\" onClick=\"".Local_ProductAddToCart()."\" style=\"cursor: pointer;\">";
}else{
   echo"<A HREF=\""; PageURL('CustomerSignIn');
   echo"\">Sign In</A> | <A HREF=\""; PageURL('CustomerSignIn');
   echo"\">Register</A>";
}

?>

Does the right thing if not signed in, but shows this and no button if they are -    javascript: ProductFormSubmit_36();

Link to comment
Share on other sites

This is a snippet from the page code on server

<tr>
            <td> </td>
            <td style="padding-top: 20px; padding-bottom: 20px;" valign="top" align="right">
                <table width="100%" border="0" cellpadding="3" cellspacing="0">
                <tbody><tr>
                    
                    <!-- Quantity Select -->
                    <td width="10%" align="left" nowrap="nowrap">
                        Quantity: 
                        <select name="quantity_in_cart">
                            <option value="1" selected="selected">1</option><option value="2">2</option><option value="3">3</option><option value="4">4</option><option value="5">5</option><option value="6">6</option><option value="7">7</option><option value="8">8</option><option value="9">9</option>                        </select>

                    </td>
                    
                    <!-- Add to Cart Button -->
                    <td align="left">
                        javascript: ProductFormSubmit_36();<img src="http://localhost/extremehairextensions/shop/avactis-templates/catalog/product-info/default/%22images/add_to_cart_button.gif%22" alt="" onclick="" style="cursor: pointer;" width="96" border="0" height="18">                    </td>

                </tr>
                </tbody></table>
            </td>
        </tr>

Thanks for all you help stephen

Link to comment
Share on other sites

i added you input to my code as follows.

 

Is an error still there, not working

 <?php

if(modApiFunc('Customer_Account','getCurrentSignedCustomer') !== null) {
   
    echo "<img src="http://localhost/extremehairextensions/shop/avactis-templates/catalog/product-info/default/%22images/add_to_cart_button.gif%22" alt="" onclick="ProductFormSubmit_36()" style="cursor: pointer;" width="96" border="0" height="18">";
}else{
   echo"<A HREF=\""; PageURL('CustomerSignIn');
   echo"\">Sign In</A> | <A HREF=\""; PageURL('CustomerSignIn');
   echo"\">Register</A>";
}

?>

Link to comment
Share on other sites

Just find out where the button is stored first, then write the code to go where the button image is.

 

<?php
echo "<IMG SRC=\"images/add_to_cart_button.gif\" WIDTH=\"96\" HEIGHT=\"18\" BORDER=0 ALT=\"\" onClick=\"".Local_ProductAddToCart()."\" style=\"cursor: pointer;\">";

?>

 

This code tells me that the image you are looking for is in the same directory you are in the image directory.

Check and see if it is there I guess.

Link to comment
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.