Jump to content

prak

Members
  • Posts

    37
  • Joined

  • Last visited

Profile Information

  • First Name
    prash
  • Last Name
    kuppa

Recent Profile Visitors

582 profile views

prak's Achievements

Newbie

Newbie (1/14)

3

Reputation

3

Community Answers

  1. Hello, I am new to PS 1.7, I have had some experience with editing invoices in PS 1.6 where there was a pdf directory in the theme for the custom templates. I want to know how to include custom templates in a ps 1.7 theme and enable them to override the default ones. Any help would be greatly appreciated!
  2. If you are using multiple taxes unlike me, I just used a base tax and broke it down differently according to the order address, I think you need to edit the invoice.tax-tab.tpl file. Best create a pdf directory in your theme and populate it with custom tpl files than edit the core prestashop pdf files.
  3. Hello, I need the taxable amount and the taxes on products to change after a voucher has been added by the customer. I am trying to write a module to do this, I want to know which hook I can use for calling my function after the new cart rule has been applied. I'm using ps 1.6.1.7. Help would be greatly appreciated, thanks.
  4. I do not think there are free modules to do this. I created the taxes and showed them in a GST compliant way by editing the invoice template files, it's not very hard. You can add new columns to the tax tab or the product tab to show the GST and the subtaxes. You can also edit the default table width, column widths etc in the style tab. Here is a part of my tpl file: <!--INTERSTATE GST--> <!--CGST, col-8--> <td class="product right">0%</td> <!--SGST, col-9--> <td class="product right">0%</td> <!--IGST, col-10--> <td class="product right"> {if $order_detail.order_detail_tax_label>0} {$order_detail.order_detail_tax_label} {else} 0% {/if} <!--GST in %, col-11--> <td class="product center"> {if $order_detail.order_detail_tax_label>0} {$order_detail.order_detail_tax_label} {else} 0% {/if} </td> <!--GST INR, col-13--> <td class="product center"> {displayPrice currency=$order_detail->id_currency price=$order_detail.total_price_tax_incl-$order_detail.total_price_tax_excl} </td> Hope this was helpful.
  5. Hello, I'm trying to create a module which displays chosen products under their category's name on the home page. I am stuck at getting the reduction percentage / amount due to a catalog price rule targeting the product's default category. I'm getting the reduction due to specific price rules using this SpecificPrice::getByProductId($tshirts[1]->id); I've tried using this for getting the reduction due to a catalog price rule: GroupReduction::getGroupsReductionByCategoryId($tshirts[1]->id_category_default); this has not worked. It returns an empty array even though a catalog price rule is targeting that category. Help would be greatly appreciated!
  6. Hello, I'm trying to make a new theme for prestashop 1.7, I want to include a custom css file. I have followed instructions in the asset management page( http://developers.prestashop.com/themes/assets/index.html) and tried to register a custom css file with this code in the theme.yml, below the 'author' key and the above the 'meta' key this way: assets: css: all: -id: mytheme-css path: assets/css/mytheme.css media: all priority: 100 The css file isn't loaded. I am a beginner to yml. Help would be greatly appreciated!
  7. Thanks for the reply vividusdesigns! That was the case. I was overthinking this whole thing instead of just checking folder permissions,lol!
  8. Hello, I'm trying to upload an image to a folder called uploads in my module's root. I have been able to accomplish this with the shop installed on my machine but I cannot upload the desired image to the remote shop. Here is my code: connector.php, to use curl to send the image to the upload.php file: require_once(dirname(__FILE__).'../../../config/config.inc.php'); require_once(dirname(__FILE__).'../../../init.php'); if (isset($_FILES['userfile']['tmp_name'])) { $ch = curl_init(); $cfile = new CURLFile($_FILES['userfile']['tmp_name'],$_FILES['userfile']['type'],$_FILES['userfile']['name']); $data = array('image'=>$cfile); curl_setopt($ch,CURLOPT_URL,_PS_BASE_URL_."/modules/customizeproducts/upload.php"); curl_setopt($ch,CURLOPT_POST,true); curl_setopt($ch,CURLOPT_POSTFIELDS,$data); $resp = curl_exec($ch); if($resp == true){ echo "success"; } else{ echo curl_error($ch); } } the upload.php file: if (isset($_FILES['image']['tmp_name'])) { error_reporting(E_ALL); $uploaddir = 'uploads/'; $uploadfile = $uploaddir . basename($_FILES['image']['name']); if (move_uploaded_file($_FILES['image']['tmp_name'], $uploadfile)) { $data = array($uploadfile,$uploaddir); echo json_encode($data); } else { echo "Possible file upload attack!\n"; print_r($_FILES); } } This is the console.log "Possible file upload attack! Array ( [image] => Array ( [name] => shoex.jpeg [type] => image/jpeg [tmp_name] => /tmp/phpkwpWFu [error] => 0 => 8373 ) ) " I'm a newbie to php and curl Help would be greatly appreciated!
  9. Turns out that it was a size issue that prevented me from uploading some images. I increased the maximum size and removed the "move_uploaded_file($_FILES['userfile']['tmp_name'], $uploadfile);" from above the echo function. It was causing the error message to display always.
  10. Hello, I want to upload an image from the backoffice, into a folder named uploads in the root directory of the module. Here is my code: <form action="/modules/customizeproducts/upload.php" enctype="multipart/form-data" method="POST"> <input type="hidden" name="MAX_FILE_SIZE" value="30000" /> Send this file: <input name="userfile" type="file" /> <input type="submit" value="Send File" /> </form> my upload.php file: $uploaddir = 'uploads/'; $uploadfile = $uploaddir . basename($_FILES['userfile']['name']); move_uploaded_file($_FILES['userfile']['tmp_name'], $uploadfile); echo '<pre>'; if (move_uploaded_file($_FILES['userfile']['tmp_name'], $uploadfile)) { echo "File is valid, and was successfully uploaded.\n"; } else { echo "Possible file upload attack!\n"; } echo 'Here is some more debugging info:'; print_r($_FILES); print "</pre>"; Help would be greatly appreciated!!!!
  11. Thanks for the reply selectshop.at but I want to accomplish this programmatically through my module. I want to create a controller which will generate all possible combinations for a product, instead of generating them one by one like the default product combination generator. Is there no way to do this?
  12. Hello, I want to create all possible combinations of a product at once, programmatically. I can see this function addAttributeCombinationMultiple in the product.php class to add them to the product but I do not know how to create all the possible combinations. Any help would be greatly appreciated!
  13. Hello, I have been able to delete product attribute groups this way: if($_GET['id']){ $id = $_GET['id']; $attribute_group = new AttributeGroup($id); $attribute_group->delete(); echo "deleted"; } I want to know how to delete a product attribute, I have tried this but this is not working: if ($_GET['id_ag']){ $id_ag = $_GET['id_ag']; $name = $_GET['name']; $attribute = new Attribute($id_ag,$name); $attribute -> delete(); echo "deleted"; } What is the right way to delete a product attribute programmatically? Help will be greatly appreciated!!
×
×
  • Create New...