Post by mikell » Fri Jan 24, 2014 4:50 am

@Nicudica

Bine zis ca "este pur orientativ ". Foarte bine explicat, merci ..Totusi , a avut loc o eroare.

Code: Select all

Notice: Undefined variable: product in /var/www/vhosts/bio-sanatate.com/httpdocs/catalog/view/theme/default/template/product/product.tpl on line 14
E ceva in neregula cu

Code: Select all

<?php if ($product['promotie']) { ?>
<div class="promotie"><?php echo $product['promotie']; ?></div>
<?php } ?>
nu cunoaste variabila product.

Active Member

Posts

Joined
Sun Sep 01, 2013 4:37 pm

Post by Xyph3r » Fri Jan 24, 2014 5:31 am

Xyph3r wrote:
Luam ca exemplu product.php
adaugi

Code: Select all

$this->data['promotie'] = $product_info['mpn'];
inaintea

Code: Select all

$this->load->model('tool/image');

Apoi in product.tpl din tema folosesti

Code: Select all

<?php if ($promotie == promotie) { ?>
	cod html aici
<?php } ?>
metoda postata anterior de nicudica se foloste pentru module si categorie, special, search..ce am postat eu se foloseste pentru product.php

Code: Select all

<?php if ($promotie == promotie) { ?>
	cod html aici
<?php } ?>


Asta se poate limita inlocui cu asta

Code: Select all

<?php if ($promotie) { ?>
	cod html aici
<?php } ?>


si oricand este scris ceva in acel camp..va arate codul html..

Daca vrei sa arate ce scrii tua colo...folosesti

Code: Select all

<div class="promotie"><?php echo $promotie; ?></div>
in locul codului html

ImageImageImage
Opencart Templates, Modules, Themes & Custom Development | ShopThemer


User avatar
Active Member

Posts

Joined
Sun Feb 10, 2013 1:08 am


Post by mikell » Fri Jan 24, 2014 3:02 pm

@Xyph3r
multumesc, dar nu stiu de ce nu merge
Am facut asa:

1. dupa ce am scris Promotie in campul MPN din admin -> editare produs -> tab Data

2. in catalog\controller\product\product.php :

Code: Select all

$this->data['stock'] = $this->language->get('text_instock');
			}
			/***************************************************************/
           $this->data['promotie'] = $product_info['mpn'];
			$this->load->model('tool/image');
           /***************************************************************/
			if ($product_info['image']) {
3. iar in catalog\view\theme\default\template\product\product.tpl

Code: Select all

 <?php if ($product['thumb']) { ?>
        <div class="image">
		<!--***********************Promotie************************-->
		<?php if ($promotie) { ?>
       <div class="promotie"><?php echo $promotie; ?></div>
        <?php } ?>
	     
         <!--***********************Promotie************************-->

Logic, ar fi tb sa functioneze!

Active Member

Posts

Joined
Sun Sep 01, 2013 4:37 pm

Post by nicudica » Fri Jan 24, 2014 5:47 pm

Saluty!

1. curata folderul vqmod/vqcache
2. verifica sa nu ai un vqmod care modifica ceva pe acolo...

O simpla verificare in controller:

echo $product['mpn']; - vei vedea daca iti afiseaza expresia introdusa de tine..

Succes..

User avatar
Active Member

Posts

Joined
Wed Nov 11, 2009 9:20 pm
Location - Bucharest / Romania

Post by mikell » Mon Jan 27, 2014 10:07 pm

@Xyph3r, te rog sa te uiti cand ai timp si sa-mi spui te rog unde am gresit...poate nu erau folderele care in care trebuia sa le modific ?! ???
Am facut asa:

1. dupa ce am scris Promotie in campul MPN din admin -> editare produs -> tab Data

2. in catalog\controller\product\product.php :
CODE: SELECT ALL
$this->data['stock'] = $this->language->get('text_instock');
}
/***************************************************************/
$this->data['promotie'] = $product_info['mpn'];
$this->load->model('tool/image');
/***************************************************************/
if ($product_info['image']) {


3. iar in catalog\view\theme\default\template\product\product.tpl

CODE: SELECT ALL
<?php if ($product['thumb']) { ?>
<div class="image">
<!--***********************Promotie************************-->
<?php if ($promotie) { ?>
<div class="promotie"><?php echo $promotie; ?></div>
<?php } ?>

<!--***********************Promotie************************-->

Active Member

Posts

Joined
Sun Sep 01, 2013 4:37 pm

Post by Xyph3r » Mon Jan 27, 2014 10:52 pm

Uite vqmod-ul cu modificarile facute pentru toate fisierele

In product.rpl folosesti "$promotie" iar in celelalte folosesti "$product['promotie'];"

ImageImageImage
Opencart Templates, Modules, Themes & Custom Development | ShopThemer


User avatar
Active Member

Posts

Joined
Sun Feb 10, 2013 1:08 am


Post by mikell » Tue Jan 28, 2014 3:13 am

Merci frumos Xyph3r; sper sa nu te fi suparat pe mine ca te-am tot intrebat! Sincere aprecieri! De abia astept sa incerc ce mi-ai trimis..

Active Member

Posts

Joined
Sun Sep 01, 2013 4:37 pm

Post by Xyph3r » Tue Jan 28, 2014 4:14 am

Sunt doar modificarile introduse prin vqmod in toate fisierele in care vrei sa introduci tu modificarea:category.php, special.php, search.php, product.php, bestseller.php, featured.php, latest.php si special.php - modul.

Nu..nu ma supar :) Daca ma suparam nu mai raspundeam..era simplu...acum sper sa nu fi omis eu ceva in xml..nu l-am testat

ImageImageImage
Opencart Templates, Modules, Themes & Custom Development | ShopThemer


User avatar
Active Member

Posts

Joined
Sun Feb 10, 2013 1:08 am


Post by mikell » Tue Jan 28, 2014 4:30 am

Am copiat in vqmod/xml ce mi-ai trimis...Am curatat si vqcache...
tot nu imi apare produsul la promotie!? :(
Mai tb. ceva; am omis ceva?

Active Member

Posts

Joined
Sun Sep 01, 2013 4:37 pm

Post by mikell » Tue Jan 28, 2014 4:37 am

Mai inainte de a copia ce mi-ai dat tu, imi aparea(astazi am obsevat; ), cand intram in Admin-Catalog-Categorii-o categorie

Code: Select all

Notice: Undefined variable: product_info in /var/www/vhosts/bio-sanatate.com/httpdocs/vqmod/vqcache/vq2-admin_controller_catalog_category.php on line 364
Nu stiu de ce pt ca eu sterg fisierele din vqcache :(

Active Member

Posts

Joined
Sun Sep 01, 2013 4:37 pm

Post by Xyph3r » Tue Jan 28, 2014 5:17 am

eroarea aia e probabil de la vreun xml pe care il ai tu

In rest...nu inteleg de ce nu iti apare... introdu direct

Code: Select all

<?php echo $promotie; ?>
si vezi ce se intampla

ImageImageImage
Opencart Templates, Modules, Themes & Custom Development | ShopThemer


User avatar
Active Member

Posts

Joined
Sun Feb 10, 2013 1:08 am


Post by mikell » Tue Jan 28, 2014 5:56 am

Unde tb sa-l copiez...? l-am copiat in catalog\view\theme\default\template\product\product.tpl
si in catalog\controller\product\product.php si degeaba

Active Member

Posts

Joined
Sun Sep 01, 2013 4:37 pm

Post by Xyph3r » Tue Jan 28, 2014 6:27 am

Dar tu ai vre-o teme custom instalate pe care o si folosesti?

Trebuie sa iti dea eroare cand il coliezi in product.tpl daca nu e definita variabila. Unde l-ai copiat acolo trebuie sa iti apara ce scrie in campul mpn din admin. iti sugerez sa il pui undeva la vedere...sa zicem dupa <?php echo $header; ?> si apoi te uiti pe website..pe o pagina a unui produs..dupa header si vezi daca iti apare ceva

ImageImageImage
Opencart Templates, Modules, Themes & Custom Development | ShopThemer


User avatar
Active Member

Posts

Joined
Sun Feb 10, 2013 1:08 am


Post by mikell » Wed Jan 29, 2014 5:30 am

@Xyph3r
-nu am nicio tema custom instalata
-Am facut ce mi-ai spus si intr-adevar, apare scris "promotie" dupa header, in pagina produsului cu promotie..

Active Member

Posts

Joined
Sun Sep 01, 2013 4:37 pm

Post by Xyph3r » Wed Jan 29, 2014 5:57 am

Deci atunci functioneaza...ai grija unde asezi div-ul..poate el apare dar nu il vezi tu.

Am testat acum la mine..totul functioneaza, eu cred ca mai ai pe undeva clasa promotie si ai asezat-o in stylesheet..i-ai pus pozitie absoluta sau float si nu vezi div-ul acum acesta... Incearca sa schimbi din "promotie" in altceva..sa zicem "promo"

Code: Select all

<?php if ($promotie) { ?>
<div class="promo"><?php echo $promotie; ?></div>
<?php } ?>

ImageImageImage
Opencart Templates, Modules, Themes & Custom Development | ShopThemer


User avatar
Active Member

Posts

Joined
Sun Feb 10, 2013 1:08 am


Post by mikell » Thu Jan 30, 2014 3:43 am

mi-a ramas in stylesheet.css ce mi-ai spus prima data(trebuia sa sterg?):
Xyph3r wrote: Apoi in stylesheet.css, adaugi "position: relative;" la

Code: Select all

.box-product .image {
	display: block;
	margin-bottom: 0px;
}
si sub portiunea asta de cod adaugi

Code: Select all

.box-product .image .promotie {
	position: absolute;
top: 0;
right: 0;
}
adica codul din stylesheet.css:

Code: Select all

.box-product .image {
	display: block;
	margin-bottom: 0px;
	position: relative;
}
.box-product .image .promotie {
 position: absolute;
top: 20;
right: 0;
}
Este singura clasa denumita promotie.
Dar am schimbat cum ai zis tu in promo si am introdus dupa <?php echo $header; ?>
codul:

Code: Select all

<?php if ($promotie) { ?>
<div class="promo"><?php echo $promotie; ?></div>
<?php } ?>

in catalog\view\theme\default\template\product\product.tpl
si mari diferente nu sunt, atat ca mi-apare scris promotie lipit de marginea din stanga a continutului..

Imi dau seama ca mai este putin pana la finalizare, dar nu stiu ce anume..poate definirea clasei promotie din stylesheet.css?!

Active Member

Posts

Joined
Sun Sep 01, 2013 4:37 pm

Post by Xyph3r » Thu Jan 30, 2014 5:35 am

pai binteinteles ca mai este..acum trebuie sa il stilizezi cum vrei din stylesheet...sa il asezi unde vrei....ii pui background si toate cele

ImageImageImage
Opencart Templates, Modules, Themes & Custom Development | ShopThemer


User avatar
Active Member

Posts

Joined
Sun Feb 10, 2013 1:08 am


Post by mikell » Thu Jan 30, 2014 5:48 am

Merci Xyph3r ,
dar cum sa-l stilizez...
un exemplu please, ca ce am eu definit in stylesheet nu ma ajuta prea mult.!

Active Member

Posts

Joined
Sun Sep 01, 2013 4:37 pm

Post by Xyph3r » Thu Jan 30, 2014 7:13 am

il stilizezi cum vrei tu...de unde sa stiu eu cu ai vrea sa arate?

ii adaugi imagine..ii pui dimensiuni..background...shadow..

http://www.w3schools.com/css/

ImageImageImage
Opencart Templates, Modules, Themes & Custom Development | ShopThemer


User avatar
Active Member

Posts

Joined
Sun Feb 10, 2013 1:08 am


Post by mikell » Thu Jan 30, 2014 6:15 pm

Multumesc pt ajutor si sfaturi Xyph3r ,
dar te mai rog ceva (daca nu e prea mult)

In catalog\view\theme\default\template\product\product.tpl este OK...
Problema este atunci cand vreau sa apara produsele promotionale in lista de produse

In catalog\view\theme\default\template\product\category.tpl
am adaugat:

Code: Select all

<?php if ($promotie) { ?>
        <div class="promotie"><?php echo $promotie; ?></div>
        <?php } ?>
dupa <div class="image">

si da urmatoarea eroare:

Code: Select all

Notice: Undefined variable: promotie in /var/www/vhosts/bio-sanatate.com/httpdocs/catalog/view/theme/default/template/product/category.tpl on line 75	

Nu cumva n-am adaugat eu unde nu trebuia codul de mai sus ?
Merci oricum...

Active Member

Posts

Joined
Sun Sep 01, 2013 4:37 pm
Who is online

Users browsing this forum: No registered users and 7 guests