Saturday, December 8, 2018

Opencart objects defined, Opencart development tutorials




Predefined objects’ methods are functionalities which are already defined and you can use it directly.


It prevents from DRY, which means Don't Repeat Yourself. Don’t write code unless you have to. Write code only what you need, if you missed these predefined objects’ methods then you may repeat codes.


You can find predefined objects’ methods at system/library


Opencart has many predefined objects’ methods that can be called in Controller and Model.  Like in admin section we can see predefined objects like: config, log, event, load, request, response, db, session, cache, url, langauge, openbay, document, customer, currency, tax, weight, length, cart, encryption, model_setting_event, user.



Database Object of Opencart is
$this->db

Methods are:
  • $this->db->escape($value) - mysql_real_escape_string() on the value passed
  • $this->db->countAffected() - rows affected by an UPDATE query
  • $this->db->getLastId() - last auto increment id same as mysql_insert_id()
  • $this->db->connected() – Pings a server connection, or tries to reconnect if the connection has gone down
$this->db->query($sql)
All SQL queries are run from $this->db->query method which looks like: $query = $this->db->query("SELECT * FROM " . DB_PREFIX . "category WHERE $this->db->query("REPLACE INTO `" . DB_PREFIX . "category_path` SET ...); $this->db->query("INSERT INTO `" . DB_PREFIX . "category_path` SET ...); $this->db->query("DELETE FROM " . DB_PREFIX . "category WHERE ...); $this->db->query("UPDATE " . DB_PREFIX . "category SET image = ...);

$this->db->query method returns three properties:  
$result->num_rows = $query->num_rows; - gets the number of rows in a results  
$result->row = isset($data[0]) ? $data[0] : array(); - get the first row data  
$result->rows = $data; - get an array of row results

Friday, December 7, 2018

How to create the database table in OpenCart?

How to create the database table in OpenCart? Video tutorial - Opencart Development


Things to consider while creating the database
OpenCart supports multistore
It supports multi-language
Multiple Layouts
oc_ is default database prefix if you have not customized one. If you are creating table then better to make 4 tables, one which will contain language specific contents here oc_information_description, another is non-language specific oc_information and other which joins with the store and last one which joins to layout.
Another database table to take into consideration is seo_url if you are creating new pages, if you are creating only for module then it may not be used

Transcript, code and ppt at:
https://webocreation.com/blog/things-consider-creating-database

Tuesday, December 4, 2018

Installing OpenCart Vesrion 3.0.2.0 - Opencart Development tutorials Video 2







  •  Download OpenCart files from http://opencart.com 
  • Create a database
  • Upload files and folders
  • Create config files one at root folder and another inside admin/ folder. 
  • Steps to create custom URL to work locally https://webocreation.com/blog/steps-create-custom-url-work-locally-xampp-localhost-virtual-host
  • Go to the URL
  • If you see any other errors then you have to solve them. One could curl disabled which you have to enable from php.ini
  • Delete the install folder, if you rename the folder then you are a by-passing error message but there will be security holes remained in that folder so the hacker can find it easily and exploit your database so strongly recommended to delete the install folder after installation is complete.


Wednesday, October 31, 2018

FiredPie is launched in Arizona




FiredPie Pizza:
fast, casual, rich in flavor customizable pizza and salad made
from scratch using fresh ingredients just the way you like it

Why fired pie started?
Every business has a story.
In this instance, Doug Doyle and Fred Morgan worked together at California Pizza Kitchen for more than 15 years, then left corporate life to start their own venture.

Check out the fired pie menu:

THE WAY THey WORK IS SIMPLE.

You have two main choices to choose from: one – pizza or salad, and two – your way or ours.
Order online fired pie pizza:
https://firedpie.com/order-online/

They are located in multiple locations in Arizona:
Fired Pie currently has twenty locations in Arizona: four in Phoenix, three in North Scottsdale, one in Gilbert, two in Mesa, two in Chandler, one in Ahwatukee, two in Glendale (Tanger Outlets Westgate & Aspera), two in Tucson (Plaza Centro & Speedway), one in Old Town Scottsdale, Fashion Square's food court, one in Avondale (Dysart Palmilla Center), and one on University Dr in Tempe.
https://firedpie.com/location/

Check out their employment opportunities
https://firedpie.com/employment/

You can contact them from
https://firedpie.com/contactus/


https://firedpie.com/page-sitemap.xml

Saturday, November 25, 2017

"Dead Code" can rot a code base over time.


"Dead Code" can rot a code base over time.
 





Monday, November 20, 2017

IceSleeve.com Hot and Cold Wraps,

IceSleeve Hot and Cold Wraps, launched successfully, where you can find the Heat therapy, Cold therapy, ergonomic and mobility, you can get details at https://icesleeve.com/Benefits. They provide following category products:
  1. Shoulder Ice wrap
  2. Shin and Calf Ice wrap
  3. Knee ice wrap
  4. Hamstring Wrap
  5. Lower back wrap
  6. Ankle ice wrap
  7. Elbow wrap
  8. Cold packs
  9. Ice bags
Special features to buy products from them can be:
  1. Customer satisfaction guaranteed https://icesleeve.com/Warranty
  2. Ship products within 24h from California warehouse https://icesleeve.com/delivery
  3. Eco-friendly, field usable, ease of use, adjustable, compression, mobility, multi-use https://icesleeve.com/about_us
  4. You can get more details of terms and conditions at https://icesleeve.com/terms
You can contact them at
https://icesleeve.com/contact
IceSleeve4720 Calle Carga
Camarillo, CA 93012
Telephone
818-814-6025
EMAILsales@icesleeve.com
Enjoy your visit at icesleeve.com and please provide feedback so that we can keep on improving it.
Thanks

Thursday, November 2, 2017

Interesting Switch case Optimization

Details at:

https://derickrethans.nl/php7.2-switch.html

<?php
$cc = "no";
$_table = [ "de" => 1, "en" => 2, "nl" => 3, "no" => 4 ];
if (gettype($cc) == 'string') {
        if (array_key_exists($cc, $_table)) {
                goto "jmp_{$_table[$cc]}";
        } else {
                goto jmp_default;
        }
} else {
        /* do original if/else if/else sequence */
}
jmp_1: echo "DEUTSCH"; goto end;
jmp_2: echo "English"; goto end;
jmp_3: echo "Nederlands"; goto end;
jmp_4: echo "Norsk"; goto end;
jmp_default: echo "unknown";
end:
?>





Friday, October 27, 2017

How to Fix the Error Setup Wizard ended prematurely


Sometime easy fix also take lots of time when you did not know what is happening, here is the easy fix for the error which keep on showing setup wizard ended prematurely.