Welkom bij Joomla!NL

Om alle mogelijkheden van dit forum te kunnen gebruiken, moet je je eerst registreren.

Zet de naam van de webshopextensie in de titel en vermeld verder in iedere vraag:
  1. De exacte versie van Joomla! die je gebruikt
  2. De exacte versie van de webshopextensie.
  3. De volledige url van je website (indien mogelijk).

Plaats van buttons veranderen

Plaats van buttons veranderen

15 feb 2013 16:46
#1
Beste allemaal,

Ik heb heel erg lang gezocht naar hoe ik custom fields op de category page kan laten zien, inclusief add to cart button.. Nu heb ik dit eindelijk gevonden, en voor elkaar gekregen, het enige is nog dat het er nog niet netjes uit ziet:

www.kunstvoorkunst.com/index.php/bestellen/snacks

Zie bovenste product..

Momenteel staan de dingen onder elkaar, (althans het custom field staat onder de "bestel" een "aantal" buttons.

Ik zou graag willen dat het er zo uit komt te zien:

Productnaam -- Custom Field -- Prijs -- Bestelknop (hiervoor wil ik graag ook een veel kleinere knop, maar dat komt later wel..)

Ik heb onderstaande codes gebruikt om te custom fields erop te krijgen:
Code:
<?php /** * * Show the products in a category * * @package VirtueMart * @subpackage * @author RolandD * @author Max Milbers * @todo add pagination * @link http://www.virtuemart.net * @copyright Copyright (c) 2004 - 2010 VirtueMart Team. All rights reserved. * @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php * VirtueMart is free software. This version may have been modified pursuant * to the GNU General Public License, and as distributed it includes or * is derivative of works licensed under the GNU General Public License or * other free or open source software licenses. * @version $Id: default.php 6053 2012-06-05 12:36:21Z Milbo $ */ //vmdebug('$this->category',$this->category); vmdebug('$this->category '.$this->category->category_name); // Check to ensure this file is included in Joomla! defined('_JEXEC') or die('Restricted access'); JHTML::_( 'behavior.modal' ); /* javascript for list Slide Only here for the order list can be changed by the template maker */ $js = " jQuery(document).ready(function () { jQuery('.orderlistcontainer').hover( function() { jQuery(this).find('.orderlist').stop().show()}, function() { jQuery(this).find('.orderlist').stop().hide()} ) }); "; $document = JFactory::getDocument(); $document->addScriptDeclaration($js); /*$edit_link = ''; if(!class_exists('Permissions')) require(JPATH_VM_ADMINISTRATOR.DS.'helpers'.DS.'permissions.php'); if (Permissions::getInstance()->check("admin,storeadmin")) { $edit_link = '<a href="'.JURI::root().'index.php?option=com_virtuemart&tmpl=component&view=category&task=edit&virtuemart_category_id='.$this->category->virtuemart_category_id.'"> '.JHTML::_('image', 'images/M_images/edit.png', JText::_('COM_VIRTUEMART_PRODUCT_FORM_EDIT_PRODUCT'), array('width' => 16, 'height' => 16, 'border' => 0)).'</a>'; } echo $edit_link; */ if ( empty($this->keyword) ) { ?> <div class="category_description"> <?php echo $this->category->category_description ; ?> </div> <?php } /* Show child categories */ if ( VmConfig::get('showCategory',1) and empty($this->keyword)) { if ($this->category->haschildren) { // Category and Columns Counter $iCol = 1; $iCategory = 1; // Calculating Categories Per Row $categories_per_row = VmConfig::get ( 'categories_per_row', 3 ); $category_cellwidth = ' width'.floor ( 100 / $categories_per_row ); // Separator $verticalseparator = " vertical-separator"; ?> <div class="category-view"> <?php // Start the Output if(!empty($this->category->children)){ foreach ( $this->category->children as $category ) { // Show the horizontal seperator if ($iCol == 1 && $iCategory > $categories_per_row) { ?> <div class="horizontal-separator"></div> <?php } // this is an indicator wether a row needs to be opened or not if ($iCol == 1) { ?> <div class="row"> <?php } // Show the vertical seperator if ($iCategory == $categories_per_row or $iCategory % $categories_per_row == 0) { $show_vertical_separator = ' '; } else { $show_vertical_separator = $verticalseparator; } // Category Link $caturl = JRoute::_ ( 'index.php?option=com_virtuemart&view=category&virtuemart_category_id=' . $category->virtuemart_category_id ); // Show Category ?> <div class="category floatleft<?php echo $category_cellwidth . $show_vertical_separator ?>"> <div class="spacer"> <h2> <a href="<?php echo $caturl ?>" title="<?php echo $category->category_name ?>"> <?php echo $category->category_name ?> <br /> <?php // if ($category->ids) { echo $category->images[0]->displayMediaThumb("",false); //} ?> </a> </h2> </div> </div> <?php $iCategory ++; // Do we need to close the current row now? if ($iCol == $categories_per_row) { ?> <div class="clear"></div> </div> <?php $iCol = 1; } else { $iCol ++; } } } // Do we need a final closing row tag? if ($iCol != 1) { ?> <div class="clear"></div> </div> <?php } ?> </div> <?php } } ?> <div class="browse-view"> <?php if (!empty($this->keyword)) { ?> <h3><?php echo $this->keyword; ?></h3> <?php } ?> <?php if ($this->search !==null ) { ?> <form action="<?php echo JRoute::_('index.php?option=com_virtuemart&view=category&limitstart=0&virtuemart_category_id='.$this->category->virtuemart_category_id ); ?>" method="get"> <!--BEGIN Search Box --><div class="virtuemart_search"> <?php echo $this->searchcustom ?> <br /> <?php echo $this->searchcustomvalues ?> <input name="keyword" class="inputbox" type="text" size="20" value="<?php echo $this->keyword ?>" /> <input type="submit" value="<?php echo JText::_('COM_VIRTUEMART_SEARCH') ?>" class="button" onclick="this.form.keyword.focus();"/> </div> <input type="hidden" name="search" value="true" /> <input type="hidden" name="view" value="category" /> </form> <!-- End Search Box --> <?php } ?> <?php // Show child categories if (!empty($this->products)) { ?> <div class="orderby-displaynumber"> <div class="width70 floatleft"> <?php echo $this->orderByList['orderby']; ?> </div> <div class="width30 floatright display-number"><?php echo $this->vmPagination->getResultsCounter();?><br/><?php echo $this->vmPagination->getLimitBox(); ?></div> <div class="vm-pagination"> <?php echo $this->vmPagination->getPagesLinks(); ?> <span style="float:right"><?php echo $this->vmPagination->getPagesCounter(); ?></span> </div> <div class="clear"></div> </div> <!-- end of orderby-displaynumber --> <h1><?php echo $this->category->category_name; ?></h1> <?php // Category and Columns Counter $iBrowseCol = 1; $iBrowseProduct = 1; // Calculating Products Per Row $BrowseProducts_per_row = $this->perRow; $Browsecellwidth = ' width'.floor ( 100 / $BrowseProducts_per_row ); // Separator $verticalseparator = " vertical-separator"; // Count products $BrowseTotalProducts = 0; foreach ( $this->products as $product ) { $BrowseTotalProducts ++; } ?> <table class="orders"> <tr> <th>Naam</th> <th>Prijs</th> <th>Aantal</th> <th> Voeg toe aan winkelwagen </th> </tr> <?php // Start the Output foreach ( $this->products as $product ) { // Show the horizontal seperator if ($iBrowseCol == 1 && $iBrowseProduct > $BrowseProducts_per_row) { ?> <div class="horizontal-separator"></div> <?php } ?> <tr> <td><?php echo JHTML::link($product->link, $product->product_name); ?></td> <td><?php // Product Short Description echo shopFunctionsF::limitStringByWord($product->product_s_desc, 40, '...') ?> </td> <td><?php echo $this->currency->createPriceDiv('basePrice','COM_VIRTUEMART_PRODUCT_BASEPRICE',$product->prices); ?> </td> <td> <form method="post" class="product" action="index.php" id="addtocartproduct<?php echo $product->virtuemart_product_id ?>"> <div class="addtocart-bar"> <?php echo $this->product->virtuemart_product_id;?> <span class="quantity-box"> <input type="text" class="quantity-input" name="quantity[]" value="1" /> </span> <span class="quantity-controls"> <input type="button" class="quantity-controls quantity-plus" /> <input type="button" class="quantity-controls quantity-minus" /> </span> <?php // Display the quantity box END ?> <?php include 'addToCartCategory.php'; ?> <?php // Add the button $button_lbl = JText::_('COM_VIRTUEMART_CART_ADD_TO'); $button_cls = ''; //$button_cls = 'addtocart_button'; if (VmConfig::get('check_stock') == '1' && !$this->product->product_in_stock) { $button_lbl = JText::_('COM_VIRTUEMART_CART_NOTIFY'); $button_cls = 'notify-button'; } ?> <?php // Display the add to cart button ?> <span class="addtocart-button"> <input type="submit" name="addtocart" class="addtocart-button" value="<?php echo $button_lbl ?>" title="<?php echo $button_lbl ?>" /> </span> <div class="clear"></div> </div> <?php // Display the add to cart button END ?> <input type="hidden" class="pname" value="<?php echo $product->product_name ?>"> <input type="hidden" name="option" value="com_virtuemart" /> <input type="hidden" name="view" value="cart" /> <noscript><input type="hidden" name="task" value="add" /></noscript> <input type="hidden" name="virtuemart_product_id[]" value="<?php echo $product->virtuemart_product_id ?>" /> <?php /** @todo Handle the manufacturer view */ ?> <input type="hidden" name="virtuemart_manufacturer_id" value="<?php echo $product->virtuemart_manufacturer_id ?>" /> <input type="hidden" name="virtuemart_category_id[]" value="<?php echo $product->virtuemart_category_id ?>" /> </form> </td> </tr> <?php } } // end of foreach ( $this->products as $product ) ?> </table></div><!-- end browse-view -->

En
Code:
<?php /** * * Show the product details page * * @package VirtueMart * @subpackage * @author Max Milbers, Valerie Isaksen * @todo handle child products * @link http://www.virtuemart.net * @copyright Copyright (c) 2004 - 2010 VirtueMart Team. All rights reserved. * @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php * VirtueMart is free software. This version may have been modified pursuant * to the GNU General Public License, and as distributed it includes or * is derivative of works licensed under the GNU General Public License or * other free or open source software licenses. * @version $Id: default_addtocart.php 6180 2012-06-28 15:36:17Z openglobal $ */ // Check to ensure this file is included in Joomla! defined('_JEXEC') or die('Restricted access'); ?> <div class="addtocart-area"> <form method="post" class="product js-recalculate" action="index.php" > <?php // Product custom_fields if (!empty($product->customfieldsCart)) { ?> <div class="product-fields"> <?php foreach ($product->customfieldsCart as $field) { ?> <div class="product-field product-field-type-<?php echo $field->field_type ?>"> <span class="product-fields-title" ><strong><?php echo JText::_($field->custom_title) ?></strong></span> <?php if ($field->custom_tip) echo JHTML::tooltip($field->custom_tip, JText::_($field->custom_title), 'tooltip.png'); ?> <span class="product-field-display"><?php echo $field->display ?></span> <span class="product-field-desc"><?php echo $field->custom_field_desc ?></span> </div><br /> <?php } ?> </div> <?php } /* Product custom Childs * to display a simple link use $field->virtuemart_product_id as link to child product_id * custom_value is relation value to child */ if (!empty($product->customsChilds)) { ?> <div class="product-fields"> <?php foreach ($product->customsChilds as $field) { ?> <div class="product-field product-field-type-<?php echo $field->field->field_type ?>"> <span class="product-fields-title" ><strong><?php echo JText::_($field->field->custom_title) ?></strong></span> <span class="product-field-desc"><?php echo JText::_($field->field->custom_value) ?></span> <span class="product-field-display"><?php echo $field->display ?></span> </div><br /> <?php } ?> </div> <?php } ?> <div class="addtocart-bar"> <input type="hidden" class="pname" value="<?php echo $product->product_name ?>" /> <input type="hidden" name="option" value="com_virtuemart" /> <input type="hidden" name="view" value="cart" /> <noscript><input type="hidden" name="task" value="add" /></noscript> <input type="hidden" name="virtuemart_product_id[]" value="<?php echo $product->virtuemart_product_id ?>" /> <?php /** @todo Handle the manufacturer view */ ?> <input type="hidden" name="virtuemart_manufacturer_id" value="<?php echo $product->virtuemart_manufacturer_id ?>" /> <input type="hidden" name="virtuemart_category_id[]" value="<?php echo $product->virtuemart_category_id ?>" /> </form> <div class="clear"></div> </div>

Iemand die mij tips kan geven?
  • ddavidd99021
  • ddavidd99021's berichtenfoto Heeft onderwerp gestart
  • Nieuw op Joomla!NL
  • Nieuw op Joomla!NL
  • Berichten: 9

Plaats van buttons veranderen

15 feb 2013 17:23 - 15 feb 2013 17:49
#2
Hoi,

Bestelknop (hiervoor wil ik graag ook een veel kleinere knop, maar dat komt later wel..)

Deze knop is opgemaakt in CSS, en is te wijzigen door een aantal waardes te veranderen.
Ik zou je de volgende tip willen meegeven, omdat je dan de pagina client side, zo naar wens kunt aanpassen. Wat het uiteindelijk makkelijker maakt om de echte bewerkingen te bepalen.

Tip: maak gebruik van de Firebug-addon voor Firefox (links naar deze tool hier te vinden). Met deze tool kan je o.a. van ieder onderdeel van de site de css definities achterhalen en waar in welk bestand ze staan. Tevens kan je met deze tool in de betreffende pagina van je site veranderingen aanbrengen in de css definities en meteen zien wat het effect is (later evt. wel zelf de aanpassingen aanbrengen in css bestanden).
Maak je gebruik van Chrome, of Internet Explorer (9 of hoger)? Dan kun je op F12 drukken om de CSS definities te achterhalen.
Groetjes, Julian.

Voordat je een vraag post, gebruik eerst de zoekfunctie van ons forum eens.
Vragen via dit forum
Wil je Joomla!NL steunen? Dat kan met een donatie.
Laatst bewerkt 15 feb 2013 17:49 door Juliank92.
  • Juliank92
  • Juliank92's Profielfoto
  • Algemeen Moderator
  • Algemeen Moderator
  • Berichten: 1722

Plaats van buttons veranderen

15 feb 2013 17:36 - 15 feb 2013 17:39
#3
Bedankt voor je reactie,

Ik heb echter toch nog wat vragen..

de plaats van
Code:
<?php include 'addToCartCategory.php'; ?>
in de bovenste code kan ik uiteraard aanpassen.. (dit is de code waarin het custom field gebeuren zit)

Het moet alleen op de juiste plaats gezet worden.. als ik het met css moet doen wordt het een rotzooi ben ik bang..

Heeft u de website bekeken? Het staat nu onder elkaar ipv naast elkaar..


Edit Juliank92: Ik heb de code tussen codetags geplaatst, volgende keer graag zelf doen.
Laatst bewerkt 15 feb 2013 17:39 door Juliank92.
  • ddavidd99021
  • ddavidd99021's berichtenfoto Heeft onderwerp gestart
  • Nieuw op Joomla!NL
  • Nieuw op Joomla!NL
  • Berichten: 9

Plaats van buttons veranderen

25 feb 2013 10:34
#4
Heb je misschien iets aan dit draadje?
Groetjes, Astrid
Gebruik de zoekfunctie van dit forum voordat je een nieuwe vraag plaatst.
Vragen uitsluitend via dit forum.
yndi.nl - kvk 17157725
Is je vraag beantwoord? Dan kan je het draadje zelf sluiten .
Wil je Joomla!NL steunen? Dat kan met een donatie.

  • Astrid
  • Astrid's Profielfoto
  • Moderator + Technisch team
  • Moderator + Technisch team
  • Berichten: 37059

Plaats van buttons veranderen

25 feb 2013 22:54
#5
ddavidd99021,

Ik ben met precies het zelfde aan het puzzelen is het jou al gelukt? Zie dat de site het volgens mij niet meer lukt.

Zoals je kan zien via dit linkje bij lever onderaan pagina 1

Staat dus het speciale veld boven de bestel knop.
Krijg hem ook niet gesplits in de extra php file die ik gebruikt heb uit dit draadje.
  • ekkie
  • ekkie's berichtenfoto
  • Bekend met Joomla!NL
  • Bekend met Joomla!NL
  • Berichten: 98
Moderators: Juliank92PeterJelleRomke
Tijd voor maken pagina: 0.943 seconden

Wil je Joomla!NL steunen?

Steun Joomla!NLAlle teamleden werken enthousiast, op vrijwillige basis, mee aan Joomla!NL. Maar een website met forum kost nu eenmaal geld. Dus als je Joomla!NL wilt steunen, dan kan dat, graag zelfs!

Lees hier meer informatie