Karl53 Posted November 13, 2011 Posted November 13, 2011 I wish to bypass the standlard catalog listing page (index.php) and the dynamically generated product pages (product_info.php). Rather, I want to have a custom landing page for about 10 or so software products and I want an "Add to Cart" button on each product page. (In other words, replace the fuctionality of the "add to cart" button found on product_info.php.) What's the correct way to code the add to cart button on my static (put still PHP) product pages? I did find this code: <?php echo tep_draw_hidden_field('products_id', $product_info['products_id']) . tep_image_submit('button_in_cart.gif', IMAGE_BUTTON_IN_CART); ?> And it adds the button to the custom product page. But the button does not work. I gather I have to hardcode a project ID and maybe some other parameter changes? Anyone have any examples? TIA
Guest Posted November 13, 2011 Posted November 13, 2011 Karl, osCommerce is a full ecommerce solution. You can't choose which functions you want and disregard the rest. Having said that, you could custom code your website to do what you want, just not with osCommerce. Chris
Karl53 Posted November 13, 2011 Author Posted November 13, 2011 That's strange. Code is code. Code can be made to do nearly anything. Furthermore, I always thought that the point of open source was that the user had access to the code so that it was possible (but maybe not easily) to get the functionality that they need/want. It strikes me as a radical solution to throw out an exisiting osCommerce site (in production) just because we now want to be able to have shoppers add products to the shopping cart from a custom product page. I would be interested to know why you say it can't be done with osCommerce.
♥mattjt83 Posted November 13, 2011 Posted November 13, 2011 Hi Karl, I think what you want IS possible with some work on your part. I am thinking that it would be the simplest to just use the product_info page as base and add if statements to include whatever customization you need for each product. if ($products_id = 101) { include('product_template_101.php'); }else{ if($products_id = .................................. You get the idea. I have never tried that in particular but I have added code to my product_info page to only show certain things on certain products. You can make osCommerce do whatever you want with some work. Matt Matt
♥toyicebear Posted November 14, 2011 Posted November 14, 2011 If you simply want to add a button for adding a product to the cart, that is quite easy (unless you also use attributes that is). You can use basically the "buy now" button code from the product listing page....which with some minor tweeks can be used at any page of the oscommerce site. If you use attributes/downloads some more changes would have to be made. Basics for osC 2.2 Design - Basics for Design V2.3+ - Seo & Sef Url's - Meta Tags for Your osC Shop - Steps to prevent Fraud... - MS3 and Team News... - SEO, Meta Tags, SEF Urls and osCommerce - Commercial Support Inquiries - OSC 2.3+ How To To see what more i can do for you check out my profile [click here]
Guest Posted November 14, 2011 Posted November 14, 2011 That's strange. Code is code. Code can be made to do nearly anything. True, as long as you are proficient enough to make it function properly. However, much of the code in osCommerce is dependent upon other functions so to take just one function and try to integrate it into other code and make it work properly will not usually work. Chris
Recommended Posts
Archived
This topic is now archived and is closed to further replies.