Jump to content

PupStar

Members
  • Content count

    896
  • Joined

  • Last visited

  • Days Won

    10

Everything posted by PupStar

  1. @wHiTeHaT should there not be a user.css be in the template directory so each template has its own css file??? currently each template would look for the root user.css Mark
  2. @wHiTeHaT I am having a little play with the template. Why is there 2 options for the template 'Internal' & 'Default' when there is only 1 template folder???
  3. @@vampirehunter well done, it works well :thumbsup: just do us all a favour and stop posting in lots of different threads :P it makes it a bloomin nightmare to follow you lol
  4. This brief guide is for anyone who wants to make their own content module. The code below shows how to make a 'Call to Action' module as inspired by the template made by Gary http://www.template.me.uk/responsive-saul/index.php This particular call to action module displays a checkout message in the header when there are products in the shopping cart prompting the user to finish their order. Step 1. Create a file in catalog/includes/modules/content/header called cm_header_call_to_checkout.php and add the following code to it: <?php /* $Id$ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com Copyright (c) 2014 osCommerce Released under the GNU General Public License */ class cm_header_call_to_checkout { var $code; var $group; var $title; var $description; var $sort_order; var $enabled = false; function cm_header_call_to_checkout() { $this->code = get_class($this); $this->group = basename(dirname(__FILE__)); $this->title = MODULE_CONTENT_HEADER_CALL_TO_CHECKOUT_TITLE; $this->description = MODULE_CONTENT_HEADER_CALL_TO_CHECKOUT_DESCRIPTION; if ( defined('MODULE_CONTENT_HEADER_CALL_TO_CHECKOUT_STATUS') ) { $this->sort_order = MODULE_CONTENT_HEADER_CALL_TO_CHECKOUT_SORT_ORDER; $this->enabled = (MODULE_CONTENT_HEADER_CALL_TO_CHECKOUT_STATUS == 'True'); } } function execute() { global $PHP_SELF, $cart, $currencies, $HTTP_GET_VARS, $request_type, $currency, $oscTemplate; $content_width = MODULE_CONTENT_HEADER_CALL_TO_CHECKOUT_CONTENT_WIDTH; if ($cart->count_contents() > 0) { $call_to_checkout .= '<div class="alert alert-danger text-center call_to_checkout" role="alert">' . sprintf(TEXT_CALL_TO_CHECKOUT, $cart->count_contents()) . ' ' . tep_draw_button(IMAGE_BUTTON_CALL_TO_CHECKOUT, 'fa fa-thumbs-o-up fa-lg', tep_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL'), 'primary', NULL, 'btn-success') . '</div>'; }else{ } ob_start(); include(DIR_WS_MODULES . 'content/' . $this->group . '/templates/call_to_checkout.php'); $template = ob_get_clean(); $oscTemplate->addContent($template, $this->group); } function isEnabled() { return $this->enabled; } function check() { return defined('MODULE_CONTENT_HEADER_CALL_TO_CHECKOUT_STATUS'); } function install() { tep_db_query("insert into configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Enable Call to checkout Module', 'MODULE_CONTENT_HEADER_CALL_TO_CHECKOUT_STATUS', 'True', 'Do you want to enable the call to checkout Box content module?', '6', '1', 'tep_cfg_select_option(array(\'True\', \'False\'), ', now())"); tep_db_query("insert into configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Content Width', 'MODULE_CONTENT_HEADER_CALL_TO_CHECKOUT_CONTENT_WIDTH', '4', 'What width container should the content be shown in?', '6', '1', 'tep_cfg_select_option(array(\'12\', \'11\', \'10\', \'9\', \'8\', \'7\', \'6\', \'5\', \'4\', \'3\', \'2\', \'1\'), ', now())"); tep_db_query("insert into configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Sort Order', 'MODULE_CONTENT_HEADER_CALL_TO_CHECKOUT_SORT_ORDER', '0', 'Sort order of display. Lowest is displayed first.', '6', '0', now())"); } function remove() { tep_db_query("delete from configuration where configuration_key in ('" . implode("', '", $this->keys()) . "')"); } function keys() { return array('MODULE_CONTENT_HEADER_CALL_TO_CHECKOUT_STATUS', 'MODULE_CONTENT_HEADER_CALL_TO_CHECKOUT_CONTENT_WIDTH', 'MODULE_CONTENT_HEADER_CALL_TO_CHECKOUT_SORT_ORDER'); } } Step 2. Create a file in catalog/includes/modules/content/header/templates called call_to_checkout.php and add the following code to it: <div class="header col-sm-<?php echo $content_width; ?>"> <?php echo $call_to_checkout; ?> </div> Step 3. Create a file in catalog/includes/languages/english/modules/content/header called cm_header_call_to_checkout.php and add the following code to it: <?php /* $Id$ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com Copyright (c) 2014 osCommerce Released under the GNU General Public License */ define('MODULE_CONTENT_HEADER_CALL_TO_CHECKOUT_TITLE', 'Call to Checkout'); define('MODULE_CONTENT_HEADER_CALL_TO_CHECKOUT_DESCRIPTION', 'Adds a call to checkout action into the Header Area of your site.'); Step 4. Add the following to catalog/includes/languages/english.php define('TEXT_CALL_TO_CHECKOUT', '<i class="fa fa-flag fa-lg"></i> You have %s item(s) in your shopping basket, click to proceed through the checkout'); Then all you need to do is go to your admin and install the module, select the width and the sort order Hopefully this will give people ideas on how to create further content modules. Mark
  5. @@vampirehunter for now you could add it to the index.php and when the index page becomes modular you could create a module and contribute it back to the community :thumbsup:
  6. @@De Dokta I always did like at least one scrolling box but I do think its a bit old hat these days. Maybe freshen it up a bit and make it fade in/out, just a thought. Mark
  7. @@burt done and done :thumbsup: Also I noticed I missed a line out of Step 3 define('IMAGE_BUTTON_CALL_TO_CHECKOUT', 'Checkout now');
  8. yes but what do you want pagination for??? there is no page 2,3,4 of the index page
  9. Heather, the file that controls the product listing is catalog/includes/module/product_listing.php Which addon have you been adding as if you have overwritten this file then you will have problems? Mark
  10. no ray the menu is not populated dynamically. The download by button only links to downloads.php, Its only in as I will be looking at downloads for a future project. This is how the template file is made up <div class="col-sm-<?php echo $content_width; ?>"> <div class="list-group"> <a class="list-group-item" href="<?php echo tep_href_link(FILENAME_PASSWORD_FORGOTTEN, '', 'SSL'); ?>"><i class="fa fa-question-circle"></i> <?php echo LOGIN_FORGOTTEN_PASSWORD; ?></a> </div> </div>
  11. @@burt with regards to a pretty login page I put this together at the weekend. I created a new template module as well (w00t)
  12. @@burt Apart from the folders, manufacturers logo and category images are all the rest of the images such as, the stars, arrows, pixel_black etc, header images and table background images obsolete and can be removed? Also with regards to styling the account.php page is there are particular reason it was coded the way it is and not like the rest of the templated modules? The reason I ask is I would like to have the segments displayed horizontal not vertical and also maybe use the list-group-item to style the individual sections. Mark
  13. @@burt Yeah I had better let someone else have a go lol Cheers mate
  14. @@burt I seem to be getting this error do you want a screenshot?
  15. @@burt yes that did solve it What a Legend :blush:
  16. @@burt also I presume the rich snippets would need adding to the review.php page??? If so I did have a bash lol but with errors <?php $reviews_query = tep_db_query($reviews_split->sql_query); while ($reviews = tep_db_fetch_array($reviews_query)) { echo '<blockquote class="col-sm-6" itemscope itemtype="http://data-vocabulary.org/Review">'; echo ' <p itemprop="description"><span class="pull-left">' . tep_image(DIR_WS_IMAGES . tep_output_string_protected($reviews['products_image']), tep_output_string_protected($reviews['products_name']), SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</span>' . tep_output_string_protected($reviews['reviews_text']) . ' ... </p><div class="clearfix"></div>'; $reviews_name = tep_output_string_protected($reviews['customers_name']); echo ' <footer>' . sprintf(REVIEWS_TEXT_RATED, tep_draw_stars($reviews['reviews_rating']), $reviews_name, $reviews_name) . ' <a href="' . tep_href_link(FILENAME_PRODUCT_REVIEWS, 'products_id=' . (int)$reviews['products_id']) . '"><span class="pull-right label label-info">' . REVIEWS_TEXT_READ_MORE . '</span></a></footer>'; echo '</blockquote>'; } ?>
  17. @@burt I cut and pasted the html from the product_info page with the product reviews module installed.
  18. @@burt I have made the changes and this is the outcome
  19. @@burt I have made the changes and this is the outcome
  20. @@auzStar @@burt thanks for all the ideas and help :thumbsup: In the end I went with just changing the template file. Mark
  21. excuse me if this has been brought up before but how do you hide say the breadcrumb, search field or even the logo only on the index page now that they are modular? Thanks Mark
  22. That is exactly what I was trying to achieve in the first place :thumbsup:
×