Adding class attribute to osCommerce tep_image function - oscommerce

I'm trying to make my product image format a certain way using CSS, but I'm not sure where to add the following code to the tep_image function call:
class="single-product"
I want the generated image to have the extra class attribute included as part of its HTML.
I'm hoping I don't have to add an if statement to the constructor class.

The tep_image function is located in \includes\functions\html_output.php.
tep_image(DIR_WS_IMAGES . $product_info['products_image'],
addslashes($product_info['products_name']),
SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT,
'class="single-product"')
Any extra attributes you need to add to the image function will be after setting the image dimensions, so place the CSS as the fifth parameter.

Related

How override woocommerce view-order template?

This page: /my-account/view-order/132616/
... is associated with the view-order.php template file under the my account section. I am able to edit this by going directly into the woocommerce plugin dir, but copying the file into /my-child-theme/woocommerce/myaccount/view-order.php does not have any effect. I am able to edit the orders.php template in this manner, but not this one. I haven't been able to find any answers online to this one: why some of these template files can be copied / overwritten and some cannot be? Also, there appears to be limited scope on applying a hook to manipulate the content on this page. What I want to do, is turn the product names listed here into links back to the products in the store. Thanks for any help!
turns out this doesn't satisfy my need since the content I'm trying to manipulate is in the woocommerce_view_order do_action. Now I'm on the hunt for a filter hook.

Changing default file upload input

I'd like to add the following attribute to the tag on the django file upload form as part of a progress bar implementation:
onchange="uploadFile()"
Do you know how I would be able to modify the default file upload input with this assignment?
You'll want to add the following to your form: field.widget.attrs["onchange"]="uploadFile()"
And include the javascript somewhere within the template being used.

woocommerce advanced templating

i´m developing a theme and for some reason i need to move the default position for breadcrubms (also for many other things) over woocommerce themes. Then i realised to do something like this on my functions.php:
function woocommerce_remove_breadcrumb(){
remove_action( 'woocommerce_before_main_content', 'woocommerce_breadcrumb', 20);
}
add_action('woocommerce_before_main_content', 'woocommerce_remove_breadcrumb');
function woocommerce_custom_breadcrumb(){
woocommerce_breadcrumb();
}
add_action( 'woo_custom_breadcrumb', 'woocommerce_custom_breadcrumb' );
And then on any template file, output the breadcrumb just with:
<? do_action('woo_custom_breadcrumb'); ?>
And works. My question is more than that. Is this the correct approach for something like this? I mean for anything over woocommerce, not just breadcrumb, for any pice, ratings, titles, buttons, sidebar, and so on.
What i´m thinking on is why woocommerce templates don´t come with more deep code. I mean, why there´s no such a single-content-loop.php template where you can just change the order of things, title, category, content, images, etc. in an easy way rather that hooking into functions?
I think that is an acceptable way to call the breadcrumbs explicitly. Sometimes it is easier to call a specific function than remove everything around it!
As for changing the order of things and getting into advanced customization; there isn't a single file, but a number of files working together. Create a folder in your themes root called 'woocommerce' and copy the following files for a safe override:
woocommerce/woocommerce-hooks.php:
Here are your hooks, including the ones you are overriding in your themes functions.php. Here is where you can experiment with removing and repositioning certain elements on your product page. Search for 'Sidebar' and you will see where the 'woocommerce_sidebar' action is added with the function it references in...
woocommerce/woocommerce-template.php:
Here are the functions used in template files to output content based on conditional statements. For instance, search for the 'Single Product' series and you can see which template files are used for which functions. For instance 'woocommerce_template_single_title' uses 'single-product/title.php' - if you copy over this folder and file you can make very specific edits to just the title section
Between these two files and their accompanying references (like title.php) I believe you can do the things you described. Let me know how it works out! I'm new to woocommerce too!

How can i use gantry object in chronoform?

I want to add css and js file in head. But my template is using gantry. So I need to use gantry object to add css and js. But this object is not accessible in my custom form code. I think my requireonce function can not include the file.
require_once('../../../../templates/rt_graffito/lib/gantry/gantry.php');
$gantry->init();
$gantry->addStyle('media/moo_rainbow/css/mooRainbow.css', 5);
$gantry->addScript('media/moo_rainbow/js/mooRainbow.js');
This is the code I am using in my chrono form. But it's not working.
I bet you can use core Joomla document object and gantry shall pick it up, try follow:
<?php
// ... some code here
$document = &JFactory::getDocument();
$document->addScript('media/moo_rainbow/js/mooRainbow.js');
$document->addStyleSheet( 'media/moo_rainbow/css/mooRainbow.css');
// ... other code
and documentation reference
http://docs.joomla.org/JDocument/addStyleSheet
http://docs.joomla.org/Adding_JavaScript

Adding views/blocks programatically to tpl.php files in Drupal 7

I am trying to integrate the awkward showcase into my page--front.tpl.php. My first idea was to create a custom content type (slideshow image) and then a view that prints a list of those images. I was able to create the view and set it to be available as a block... but I have no idea how to include that block via my .tpl.php file. I don't want to just use the content region because it displays a bunch of "hello welcome to $sitename" messages that I couldn't figure out how to remove.
Also, what is the naming convention for views blocks? The machine name for the view I want to create a template of is called 'front_page_slideshow'
There's a way of adding views programatically,
the easiest way is using "views_embed_view()" http://api.drupal.org/api/views/views.module/function/views_embed_view/7
$view = views_embed_view('view_name', 'display', $args);
print $view;
For render a block (any kind of block) use this simple script I created:
https://gist.github.com/4001153
I would create a region['slideshow'] in your template. Then you assign the view that you've already created into it as a block. If you want to get really simple, till you figure how to drupal properly, you can just hack your page--front.tpl.php file and use include('yourslideshowfile.php'); to simply include your file there.