WordPress.org

Ready to get started?Download WordPress

Forums

WordPress Ultra Simple Paypal Shopping Cart
Append text from input to product title? (1 post)

  1. PinkishHue
    Member
    Posted 1 year ago #

    Is it possible to append some data from a text input (or any kind of form input) to the product title?

    I have tried this (code below) but wherever I put $datepicked (my input) it will not add it to the title field. I'm not greatly experienced in PHP coding.

    /---- start code
    ' <input type="text" id="datepicker" name="datepicked" />
    <?php $datepicked = $_POST["datepicked"]; ?>

    <?php if( get_field( "price-adult" ) ): ?>
    <div class="ticketsection">
    <div class="tickettype">Adult <span>(over 13)</span> <span class="ticketprice">£<?php the_field( "price-adult" ); ?></span>
    </div>
    <?php $priceadult = get_field( "price-adult" ); ?>
    <?php $name = get_the_title( '', ' (adult)' ); ?>
    <?php echo print_wp_cart_button_for_product($name, $priceadult); ?>

    </div>
    <?php endif; ?>
    '
    ----/ end code

    Thanks for any help anyone can suggest :)

    http://wordpress.org/extend/plugins/wp-ultra-simple-paypal-shopping-cart/

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.