opencart

Opencart custom admin area -> queries only showing first record of tables

与世无争的帅哥 提交于 2019-12-24 13:10:01
问题 I am having a problem with some custom pages that I am creating in Opencart for a big school project. More specifically, it seems that the model is not passing any query data to the controller and the view is unable to display the data. I read this post (How to create a custom admin page in opencart?) and started working from there. The idea is basically to create a portal where the admin can review all orders, all customers, all products and edit the products. Now, as I am quite new to

Php - passing a variable from controller to view

断了今生、忘了曾经 提交于 2019-12-24 12:05:15
问题 whenever I run this code i get the error of undefined variable $d, so i noticed i have to pass the variable from the controller to the view. I am new to MVC, hence why i would be grateful if someone helps me with this issue. This is my implementation so far: ** Controller ** class ControllerModuleGetstoreproducts extends Controller{ public function index() { $object = new ModelGetstoreproducts(); $d = $object->fetch(); require_once "getstoreproducts.php"; } function returndata(){ $this->db-

Save data created in OpenCart 2.3 event for later display

浪尽此生 提交于 2019-12-24 10:37:00
问题 I see how to use an event to generate a controller call in OpenCart 2.3. What I don't see is how to save the data created by the controller call for later use in a view. How have other people handled this? 回答1: Not sure exactly what you want to do here but couldn't you just do something like: file_put_contents(DIR_CACHE . __CLASS__ . __FUNCTION__ . md5(serialize($this->request->get)) . '.ser', serialize($data)); That would store everything in $data (which is everything that gets passed to the

Opencart minimum order price exclude one category

巧了我就是萌 提交于 2019-12-24 05:53:28
问题 I am using opencart and successfully added minimum order price for all transactions. This is the code I used: <?php if ($this->cart->getSubtotal() >= 10) { ?> <div id="payment"><?php echo $payment; ?></div> <?php } else { ?> <div class="warning">Minimum 10 Euro to checkout</div> <?php } ?> Now I want to exclude one category out of it so that $9 product from that category can be bought. Update 1: Thank you so much for the help shadyyx I tried shadyyx method but I am getting this error:

How to create a static About us page in opencart

那年仲夏 提交于 2019-12-24 03:13:09
问题 I am a beginner in using opencart.I need to create an About us page from admin and have to link it to my main menu navigation.How to get this? 回答1: Step 1 : Goto information link in catalog tab Step 2 : click to insert a page or information page like about us Step 3 : if you have enabled seo then you can write keyword for you aboutus page or information page then your url will be easy to use e.g below if seo is disbaled then your url will be little boring e.g( index.php?route=information

Issue on store credit of opencart 1.5.6

筅森魡賤 提交于 2019-12-24 02:35:11
问题 I want to create an order for a customer in the administration. The customer has certain credit (let's say $200). The order total is calculated like order total - customer's credit = new order total . The problem is the customer's credit does not change after creating an order. For example: the order total is: $500 credit is: $200 then the order total is : $500 - $200 = $300 but the customer's credit is still: $200 Has anybody else had the same problem? I try to change the status of that

Opencart: Adding Buy Now Button in Opencart Product Page

安稳与你 提交于 2019-12-24 02:16:05
问题 I was adding a Buy Now button in opencart product page (also add to cart will be there) First i edited catalog/view/theme/mytheme/template/product/product.tpl (to get Buy Now button in product page) <?php if ($stock == "In Stock") { echo '<input type="button" value="Add to Cart" id="button-cart" class="button-product-page" />'; echo " "; echo '<input type="button" value="Buy Now" id="button-cart-buy" class="button-product-page" />'; } else {echo '<input type="button" value="Out Of Stock"

Opencart Login to Previous Viewed Page After Logging in?

独自空忆成欢 提交于 2019-12-23 20:58:36
问题 Opencart Login to Previous Viewed Page After Logging in? Anyone know a way this can be done? Working on Version 1.5.4 Hope someone can advise/help! Thanks! 回答1: To achieve this scenario: User clicks on Log In link. User fills the login form and clicks on submit button. After he is logged in You want him to redirect to the page from which he clicked on Log In link. You would have to edit catalog/controller/account/login.php controller . Add this right after the public function index() { line:

Images not showing in Chrome until I click inspect element

≯℡__Kan透↙ 提交于 2019-12-23 20:18:22
问题 I have encountered a strange bug using my OpenCart website in Chrome. The product images are not showing up but I see the white area where they should come. If a product doesn't have an image it's aligned to the left but in this case I can see the white area where the picture normally is. And here's the crazy part, if I click on inspect element, suddenly the image appears. Some css code .product-list .image { float: left; margin-right: 10px; overflow: auto; } 回答1: In the CSS you need to set

How does free checkout work in Opencart 2?

老子叫甜甜 提交于 2019-12-23 20:14:08
问题 I am trying to make a development site where I can add products to my cart and delivery options - and then checkout. I want to be able to do dummy orders without using real cards or payment gateways I have enabled free checkout but it does not appear on the OpenCart admin panel? 回答1: In OpenCart, Free Checkout payment option only show up when order total equals to zero . To enable/disable Free Checkout: /Admin => Extensions => Payments => Free Checkout Remember, it's only show up when Total =