Posted By

cerxx on 09/12/18


Tagged

opencart


Versions (?)

Get Seo Url Alias for category Opencart


 / Published in: PHP
 

URL: https://translate.google.com.ua/translate?hl=ru&sl=en&tl=ru&u=https%3A%2F%2Fstackoverflow.com%2Fquestions%2F20245791%2Fopencart-get-the-product-seo-url-from-within-admin&anno=2

Class Model opencart get the categiry seo url

  1. <?php
  2. class ModelExtensionModuleOctCategoryWall extends Model {
  3. public function getSeoUrl($value, $route = "product/category", $key = "path"){
  4. $url = "index.php?route={$route}&{$key}={$value}";
  5. if($key == "path"){
  6. $url_query = "category_id";
  7. } else {
  8. $url_query = $key;
  9. }
  10. if($this->config->get('config_seo_url')){
  11. $query = $this->db->query("SELECT * FROM " . DB_PREFIX . "url_alias WHERE `query` = '" . $this->db->escape($url_query . '=' . (int)$value) . "'");
  12. if($query->row['keyword']){
  13. $url = $query->row['keyword'];
  14. }
  15. }
  16.  
  17. return $url;
  18. }
  19. }
  20. ?>

Report this snippet  

You need to login to post a comment.