Jump to content
Latest News: (loading..)

JcMagpie

♥Ambassador
  • Content count

    833
  • Joined

  • Last visited

  • Days Won

    45

JcMagpie last won the day on September 16

JcMagpie had the most liked content!

5 Followers

Profile Information

  • Real Name
    Zahid
  • Gender
    Male
  • Location
    London
  • Interests
    Chilling out with a cold drink and music.
  • Website

Recent Profile Visitors

3,669 profile views
  1. There are times when you need to get information about products or customers that is not shown in the admin side of the store. If you are happy to use phpAdmin then its easy to get it direct from the database by running a sql query. If your not keen on doing that then a simple alternative is to simply use a php file to display the data on screen. Using stock CE lets assume we want to see all customers who purchased a particular product. The code below looks in the database tables “orders” and “orders_products” for a product with the ID of 34 and prints onto the display all customers who purchased that product. The code can show much more depending on how you set the filters. <?php /* Attempt MySQL server connection. Assuming you are running MySQL server with default setting (user 'username' password'database name) */ $link = mysqli_connect("localhost", "username", "password", "database name"); // Check connection if($link === false){ die("ERROR: Could not connect. " . mysqli_connect_error()); } // Attempt select query execution $sql = "SELECT * FROM orders_products,orders where orders_products.products_id = 34 AND orders.orders_id Group by orders.orders_id "; if($result = mysqli_query($link, $sql)){ if(mysqli_num_rows($result) > 0){ echo "<table>"; echo "<tr>"; echo "<th>id</th>"; echo "<th>name</th>"; echo "<th>email</th>"; echo "<th>telephone</th>"; echo "<th>orders-ID</th>"; echo "<th>company name</th>"; echo "<th>country</th>"; echo "<th>product ID</th>"; echo "<th>Model</th>"; echo "<th>Name</th>"; echo "<th>quantity</th>"; echo "<th>Price</th>"; echo "</tr>"; while($row = mysqli_fetch_array($result)){ echo "<tr>"; echo "<td>" . $row['customers_id'] . "</td>"; echo "<td>" . $row['customers_name'] . "</td>"; echo "<td>" . $row['customers_email_address'] . "</td>"; echo "<td>" . $row['customers_telephone'] . "</td>"; echo "<td>" . $row['orders_id'] . "</td>"; echo "<td>" . $row['customers_company'] . "</td>"; echo "<td>" . $row['customers_country'] . "</td>"; echo "<td>" . $row['products_id'] . "</td>"; echo "<td>" . $row['products_model'] . "</td>"; echo "<td>" . $row['products_name'] . "</td>"; echo "<td>" . $row['products_quantity'] . "</td>"; echo "<td>" . $row['products_price'] . "</td>"; echo "</tr>"; } echo "</table>"; // Free result set mysqli_free_result($result); } else{ echo "No records matching your query were found."; } } else{ echo "ERROR: Could not able to execute $sql. " . mysqli_error($link); } // Close connection mysqli_close($link); ?> Here we see what is shown on the screen, As you can see all orders for product with ID 34 are listed with customers info. Using the same code with a small change we can list all order placed by each customer. The only chnage in the code is this line, All we are doing is geting data from 2 tables and sorting it with a filter for orders_id and orders_products_id common to a customers_id. $sql = "SELECT * FROM orders,orders_products where orders.orders_id = orders_products.orders_products_id"; The whole code is, <?php /* Attempt MySQL server connection. Assuming you are running MySQL server with default setting (user 'username' password' database name) */ $link = mysqli_connect("localhost", "username", "password", "database name"); // Check connection if($link === false){ die("ERROR: Could not connect. " . mysqli_connect_error()); } // Attempt select query execution $sql = "SELECT * FROM orders,orders_products where orders.orders_id = orders_products.orders_products_id"; if($result = mysqli_query($link, $sql)){ if(mysqli_num_rows($result) > 0){ echo "<table>"; echo "<tr>"; echo "<th>id</th>"; echo "<th>name</th>"; echo "<th>email</th>"; echo "<th>telephone</th>"; echo "<th>orders-ID</th>"; echo "<th>company name</th>"; echo "<th>country</th>"; echo "<th>product ID</th>"; echo "<th>Model</th>"; echo "<th>Name</th>"; echo "<th>quantity</th>"; echo "<th>Price</th>"; echo "</tr>"; while($row = mysqli_fetch_array($result)){ echo "<tr>"; echo "<td>" . $row['customers_id'] . "</td>"; echo "<td>" . $row['customers_name'] . "</td>"; echo "<td>" . $row['customers_email_address'] . "</td>"; echo "<td>" . $row['customers_telephone'] . "</td>"; echo "<td>" . $row['orders_id'] . "</td>"; echo "<td>" . $row['customers_company'] . "</td>"; echo "<td>" . $row['customers_country'] . "</td>"; echo "<td>" . $row['products_id'] . "</td>"; echo "<td>" . $row['products_model'] . "</td>"; echo "<td>" . $row['products_name'] . "</td>"; echo "<td>" . $row['products_quantity'] . "</td>"; echo "<td>" . $row['products_price'] . "</td>"; echo "</tr>"; } echo "</table>"; // Free result set mysqli_free_result($result); } else{ echo "No records matching your query were found."; } } else{ echo "ERROR: Could not able to execute $sql. " . mysqli_error($link); } // Close connection mysqli_close($link); ?> To use simply save the required code as say get_product_info.php, I would save it in your admin directory to keep it secure! Don't for get you need to enter you own details at the head of the file to connect to your database. /* Attempt MySQL server connection. Assuming you are running MySQL server with default setting (user 'root' password'database name) */ $link = mysqli_connect("localhost", "username", "password", "database name"); We are only reading from the db so should not have any problems but as allways to be safe backup first.
  2. JcMagpie

    Navbar Links

    Yeah sorry, no known cure for stupid!
  3. JcMagpie

    Navbar Links

    It's a bit basic but then so am i! should work.😊 NavBar Links.zip
  4. JcMagpie

    1034 - Incorrect key file for table

    If repair has failed it means the table was badly corrupted! restore db from backup.
  5. Came across a small issue with tpl_cm_header_breadcrumb.php when doing some editing. Looks like the name has been duplicated, <div class="col-sm-<?php echo $content_width; ?> cm-header-breadcrumb breadcrumbs"> If it's allready been spoted the sorry for duplication.
  6. JcMagpie

    Site been working for a year, now broken!

    Trying to remotly debug like this is never going to be easy. If you think its the .htaccess then just remove everything and add it back one rule at a time to see whch is the problem. You shoud not need this? <IfModule mime_module> AddType application/x-httpd-ea-php72 .php .php7 .phtml </IfModule> This is questionable do you know why your using it? "The ETag HTTP response header is an identifier for a specific version of a resource. It allows caches to be more efficient, and saves bandwidth, as a web server does not need to send a full response if the content has not changed. On the other side, if the content has changed, etags are useful to help prevent simultaneous updates of a resource from overwriting each other ("mid-air collisions"). If the resource at a given URL changes, a new Etag value must be generated. Etags are therefore similar to fingerprints and might also be used for tracking purposes by some servers. A comparison of them allows to quickly determine whether two representations of a resource are the same, but they might also be set to persist indefinitely by a tracking server." <IfModule mod_headers.c> Header unset ETag </IfModule> FileETag None
  7. JcMagpie

    Pay what you want pricing

    Sure I understand people changing booking will cause issues with payments. Well you still have the 2 options listed above, but if you insist on having something the customer can enter an amount into you will have to look at adding that function to you cart as it's not in stock osC. You can ask a developer to make you something or you can use an existing add-on and update/change it to your needs, This old donations add-on should be all you need just update to your requirements. You will still need a dummy product to get them to the checkout to make the donation/ payment correction. https://apps.oscommerce.com/Ppmpx Oh and if you get it working why not post it back so others can make use of it. It's interesting that on of the main competitors has a Name Your Price option 😊 "Let Customers Pay What They Want With Name Your Price" Could be very useful if you have slots that are not popular! The customers could then offer a price to use them? May also be good for getting rid of old or dead stock, just let the customer name a price.
  8. JcM Header Categories This is a simple header add-on that lets place categories at the top of your site. It’s nothing fancy it just makes use of the stock osC categories function. It’s best used for sites with a small number of cats. Also on mobile devices the cats are shown at the top of the device rather than at the bottom as is with stock CE. It’s a no core change add-on. Simply install and turn on like any other add-on. It’s got some css in the template file to show on install but you can remove that or override it in your user.css. The options for styling are endless. That’s it. It has only been tested on CE.
  9. JcMagpie

    Site been working for a year, now broken!

    RewriteCond %{HTTPS} !on Is known to have issues on some server set-ups and can misbehave.
  10. JcMagpie

    Site been working for a year, now broken!

    Speak to your host, most good hosts will have nightly or weekly backups you can restore from. You may even find that you can do it yourself, check in your control panel. As you don't know what caused it, just restoring may not help but it's worth a try. As you think 2 key changes were made. First I would roll back the php update. Check with your host most now allow you to use the php version you require. If that makes no difference, then check the ssl you indroduced even turn it off for a while and check. To force all of the web traffic (every link in your website) to use HTTPS insert the following lines of code in the .htaccess file: RewriteEngine On RewriteCond %{HTTPS} off RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
  11. JcMagpie

    Need to update for TLS 1.2

    😊 Well first use a smaller font, my eyes hurt reading that! Also first check if you have a problem by testing your site. https://www.ssllabs.com/ssltest/ For paypal see this, https://www.paypal.com/uk/smarthelp/article/why-do-i-need-to-upgrade-my-system-to-tls-1.2-faq3898 Then follow this thread, hopfully that will help.
  12. Sorry was a silly bug in original upload that meant the slider indicators did not work. Have fixed this and corrected some other issues. A full new package has been uploaded. If you have already installed, then turn off the module and then uninstall the add-on from admin. Only after doing this should you then copy all new files, then install and turn on. Should not affect any banners already made. https://apps.oscommerce.com/eI6qf&amp;header-osc-banner-rotator
  13. To answer your question, yes there is a bug list All software will have some level of bug’s no matter how hard you try, its just a fact of life. I would not hold your breath for an update to CE! I think any update if at all will probably be with Bootstrap 4. I think for people who decide to use the current CE with bootstrap 3 to make small bug fixes themselves is not a big ask. I have “frozen” all my sites on current CE, It’s a perfectly good cart as is.
  14. Header osC Banner rotator This is not my code, simply updated a 2015 code by vampirehunter So it will work with CE. This is a header carousel add-on that lets you make use of the stock osC banner function. It’s a no core change add-on. Simply install and turn on like any other add-on. Then go to admin/tools and use banner manager to make a new banner. The groups must be set to “Rotator” This is a carousel so you need to make a number of banners each set to “Rotator” It has only been tested on CE. In the image below you can see it working, directly below is the simple header banner add-on released earlier, they can be used together without any issues. Don’t forget the number of banners set up need to match the number set in the addon. That’s it enjoy.😊
  15. 😊Post your request in the right place for paid work. Commercial Support
×