Jump to content

cokenour

Members
  • Posts

    12
  • Joined

  • Last visited

cokenour's Achievements

Newbie

Newbie (1/14)

2

Reputation

  1. Funny...I didn't even think of that. Well, that works but presents a different problem. It required that work around any time I edit that particular CMS page. This makes the site less able to be administered by someone other than me (or another designer). Thanks for the tip. I may use that for now while I look for another option.
  2. No problem at all. I do want the Google map in a CMS page. I've created a map on Google that lists all the locations for the business. The embed code for that map (the code provided by Google) is in an iframe. Your point about the lack of cross browser support is a good one, I'm going to look around for another way to make it work. Iframes are frustrating because they haven't been completely deprecated and yet they have limited support.
  3. Thanks. That's a decent module, but I need something that will display in a CMS page. Also, I'm using a "My Map" from Google Maps with multiple locations and other info included on it. So ideally I want to avoid using GPS markers for the map. Is there a way to get the html editor to allow iframes?
  4. I'm trying to insert an embed snippet from a Google Map into a CMS page. The html editor strips out the iframe and some other code. Sure there is a simple way around this...help!
  5. Nevermind...I'm a dork. I didn't realize that when you click the flag icon in a CMS page it opens the option to choose your translation. I assumed that all translations would be in the "Translations" menu. ----------------------------------------------- I have a site I'm doing in English and Spanish. The translation for core of Prestashop works great...but I also need to translate the CMS pages I've created. Is there a way to do this within the PS admin?
  6. Ok, I've got the initial report working. First, I created a new "Reports" tab. I explained that in this post. Before doing anything below, you need to finish that step first. The first report just needed to show the name, phone(s), email, and purchase date for each customer who bought a given product. 1. I created a new file and called it AdminReportCode.php and placed it in the admin/tabs directory. 2. Then I put an include statement into my AdminReports.php file. This is the file that controls the display of my "Reports" tab. Because I had copied an existing tabs file to create AdminReports.php, the core code was still there. Look for the code below and insert the include statement. You can move it around. I put it there because it rendered the page the way I preferred. /* ATTACH CCS TO DEFINE PRINTABLE AREA FOR THE REPORT - THIS REMOVES THE EXTRA PAGE ELEMENTS AND PRINTS JUST THE REPORT DATA */ <head> <link rel="stylesheet" href="../themes/yourtheme/css/print.css" type="text/css" media="print" /> </head> public function display() { echo ''.$this->l('Reports').''; echo ' '.$this->l('You can run CCS reports from this page.').''; echo ' '; echo $query; /* INCLUDE STATEMENT */ include(PS_ADMIN_DIR.'/tabs/AdminReportCode.php'); echo ''; } 3. Then open AdminReportCode.php. Here's what I did: > <?php /** CODE TO QUERY ALL PRODUCTS **/ echo " Product Report: Select One"; include ‘config.php’; include ‘opendb.php’; $classlistquery="SELECT id_product, id_lang, name FROM ps_product_lang WHERE id_lang = '1' ORDER BY id_product"; $result=mysql_query($classlistquery); include ‘closedb.php’; /** END OF DROPDOWN QUERY **/ /** CODE TO CREATE A FORM WITH DROPDOWN BASED ON QUERY RESULTS **/ echo "<form action='".$_SERVER['php_self']."' method='post'>"; echo "\n"; while ($data = mysql_fetch_array($result, MYSQL_ASSOC)) { echo " {$data['name']}\n"; } echo "\n"; echo "<input type='submit' name='submitReport' value='Submit'>\n"; echo "</form>\n"; /** END DROPDOWN **/ /** CODE TO RENDER THE REPORT ONCE THE USER CLICKS SUBMIT **/ if (isset($_POST['submitReport'])) { $entry = $_POST['class'] ; include ‘config.php’; include ‘opendb.php’; $classparticipantsquery="SELECT ps_orders.invoice_date, ps_customer.lastname, ps_customer.firstname, ps_customer.email, ps_order_detail.product_name, ps_product_lang.name, ps_address.phone, ps_address.phone_mobile FROM ps_orders JOIN ps_customer ON ps_orders.id_customer = ps_customer.id_customer JOIN ps_order_detail ON ps_order_detail.id_order = ps_orders.id_order JOIN ps_product_lang ON ps_order_detail.product_name = ps_product_lang.name JOIN ps_address ON ps_address.id_customer = ps_customer.id_customer WHERE ps_order_detail.product_name='$entry' AND ps_product_lang.id_lang = '1' ORDER BY ps_customer.lastname"; $result = mysql_query($classparticipantsquery); include ‘closedb.php’; $num=mysql_numrows($result); /* Notice the class='print' - this class style is body {visibility:hidden;} .print {visibility:visible;} */ echo "</pre> <table>"; echo " Product Sales Report For '$entry' Ordered By Last Name"; echo " Print Report"; $i=0; while ($i < $num) { $last=mysql_result($result,$i,"lastname"); $first=mysql_result($result,$i,"firstname"); $email=mysql_result($result,$i,"email"); $class=mysql_result($result,$i,"product_name"); $date=mysql_result($result,$i,"invoice_date"); $phone=mysql_result($result,$i,"phone"); $mobile=mysql_result($result,$i,"phone_mobile"); echo "$last, $first Class: $class E-mail: $email Phone: $phone Mobile Phone: $mobile Signed Up: $date "; $i++; } echo "</table>"; <br> exit;<br> }<br>/** END ROSTER REPORT **/<br>?&gt Again, this is a simple report. I've only been working with SQL for about a year and PHP for about a month. I did some ColdFusion stuff before that. So I'm sure there are better ways to do it, but this is what I came up wi Hope it helps!
  7. My application for it is this: I'm using PrestaShop to sell seats for a continuing education center. Each class seat is sold just as any other product would be. At the minimum they need a report that shows who's in each class (i.e., a report of who has purchased a given product). My solution (or what I'm attempting...it's not done yet): 1. I created a "Reports" tab and added it to the admin area. 2. I then created a new user (employee in PrestaShop) and restricted their permissions to only view the newly created "Reports" tab. 3. I'm in the process of figuring out exactly what my db query needs to be. 4. Once the query is done I'll add the necessary code to the "Reports" tab so that users with permissions for that tab can run the report. I don't see any reason why you couldn't use this for any client. I think it could be built into a full-fledged custom reports area. I'll be happy to share what I have once it's working.
  8. great thanks! I came across it yesterday after realizing I could search product names across the entire db using phpMyAdmin (I'm learning this as I go). I think the ps_product_lang table will do the trick.
  9. I'm trying to create another custom report. This one will list all sales for a product specified by the user via selection from a dropdown menu. The first thing I need is to query the db for all products and be able to display the product name. I have found the name in ps_order_detail.product_name, but that doesn't suit my needs because this table only reflects products that have been ordered. I need to list ALL products. Where can I find the product name? I've been digging through the entire db via phpMyAdmin and can't find anything except id_product. Thanks, Cokenour
  10. [sOLVED] Here's what I did to create my own custom reports tab (yes, I'm a PS newbie, but hopefully this will help others): 1. FTP'd down AdminTools.php 2. Renamed AdminTools.php to AdminReports.php (could be whatever name you want) 3. Opened AdminTools.php and changed any references to AdminTools to AdminReports. 4. Save AdminReports.php and FTP up to the site in the same directory where AdminTools.php was located. 5. Login to the admin back end of PrestaShop. 6. Goto Tools >> Tabs >> click "Add New". 7. Enter the name (I used "Reports"); Class=AdminReports; img (your choice, I copied the translations icon, colored it in Photoshop and use that); Parent="Home". 8. Click Save. The "Reports" tab will now appear in your admin tabs list. REMEMBER: it's sill a copy of the "AdminTools.php" file, so it's functioning the same way. You'll need to go back to the "AdminReports.php" file and edit it to include whatever functionality you want. In my scenario, this is a great solution because now I can create custom PHP sales reports that will run from this page and just as importantly, because it's in the PrestaShop admin area I can create a "Reports" user and restrict their permissions to ONLY use the reporting feature. This is what I came up with. Please correct anything that could be done better.
  11. Anyone know what class to use when adding a new tab?
  12. I've developed my first PrestaShop site that also required creating a custom sales report. My problem is figuring out how to integrate my report into the admin back end of PrestaShop. I've created a 'Reports' tab and placed it under 'Tools', but found it doesn't work because the "Class" value is wrong. When creating a new tab, what the "Class" value be set to? Am I missing a step? My goal is to end up with a "Reports" tab that will hold the PHP report I've created (and others later on). Thanks for any help you can offer! Cokenour
×
×
  • Create New...